POST /letters does not work correctly
- Dominant language
- JavaScript
- Stars
- 4
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
```
//== REQUEST
http://test-api.javascript.ru/v1/alxpsr-test/letters
```
```
//== BODY (JSON)
[
{ "mailbox": "",
"subject": "Заказ пиццы",
"body": "Заказ оплачен",
"to": "ivanov@e1.ru"
},
{
"mailbox": "",
"subject": "Заказ суши",
"body": "Заказ оплачен",
"to": "ivanov@e1.ru"
},
{
"mailbox": "",
"subject": "Заказ носков",
"body": "Заказ оплачен, носки придут почтой",
"to": "petrov@e1.ru"
},
{
"mailbox": "",
"subject": "Заказ трусов",
"body": "Заказ оплачен,трусы придут почтой",
"to": "petrov@e1.ru"
},
{
"mailbox": "",
"subject": "Заказ автозапчастей",
"body": "Заказ принят, ждите",
"to": "sidorov@e1.ru"
},
{
"mailbox": "",
"subject": "Заказ ремня ГРМ",
"body": "Заказ принят, ждите",
"to": "sidorov@e1.ru"
}
]
```
```
//== RESPONSE
{
"errors": {
"to": "'To' is required",
"body": "Body is required",
"subject": "Subject is required",
"mailbox": "Mailbox must be set"
}
}
```
If i send only one object of user - response will come with success.
Probably controller expect `Object` but not `Array`
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce POST /v1/alxpsr-test/letters with the six-item JSON array, then compare it with the documented single-object request that succeeds. Inspect the /letters request handler and validation entry point; done means array requests are processed successfully with the expected response while single-object behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100