NexdApp/nexd-backend

POST api/request returns an invalid (or undocumented) status

andre-stefanov opened this issue · 2 comments

After creating a new request, endpoint returns request status "new" even if only "pending|ongoing|completed" are documented.

POST /api/request HTTP/1.1
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaXJzdE5hbWUiOiJBbmRyZSIsImxhc3ROYW1lIjoiUG9zdG1hbiIsImVtYWlsIjoicG9zdG1hbkBhbmRyZS5kZSIsInN0cmVldCI6bnVsbCwibnVtYmVyIjpudWxsLCJ6aXBDb2RlIjpudWxsLCJjaXR5IjpudWxsLCJ0ZWxlcGhvbmUiOm51bGwsImlkIjo2LCJyb2xlIjoibm9uZSIsImlhdCI6MTU4NDkyNjk4NCwiZXhwIjoxNTg0OTMwNTg0fQ.h4GytYoAGZ64rKCUuorB7tofwY-pqYwr05gJby7zf0g
User-Agent: PostmanRuntime/7.23.0
Accept: */*
Cache-Control: no-cache
Postman-Token: 2ceb8cc4-c084-4679-a434-6ec2aa852d38
Host: nexd-api-alb-1107636132.eu-central-1.elb.amazonaws.com
Accept-Encoding: gzip, deflate, br
Content-Length: 791
Connection: keep-alive
{
    "additionalRequest": "",
    "articles": [
        {
            "articleCount": 0,
            "articleId": 1
        },
        {
            "articleCount": 0,
            "articleId": 2
        },
        {
            "articleCount": 1,
            "articleId": 3
        },
        {
            "articleCount": 1,
            "articleId": 4
        },
        {
            "articleCount": 0,
            "articleId": 5
        },
        {
            "articleCount": 1,
            "articleId": 6
        },
        {
            "articleCount": 0,
            "articleId": 7
        },
        {
            "articleCount": 1,
            "articleId": 8
        },
        {
            "articleCount": 0,
            "articleId": 9
        }
    ],
    "status": "pending"
}
HTTP/1.1 201 Created
Date: Mon, 23 Mar 2020 01:54:54 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 1032
Connection: keep-alive
X-DNS-Prefetch-Control: off
X-Frame-Options: SAMEORIGIN
Strict-Transport-Security: max-age=15552000; includeSubDomains
X-Download-Options: noopen
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
Access-Control-Allow-Origin: *
ETag: W/"408-bM8nmfheSXRV8FqntIdeXmiYoPE"
{"articles":[{"articleId":1,"articleCount":0,"articleDone":false,"id":50},{"articleId":2,"articleCount":0,"articleDone":false,"id":51},{"articleId":3,"articleCount":1,"articleDone":false,"id":52},{"articleId":4,"articleCount":1,"articleDone":false,"id":53},{"articleId":5,"articleCount":0,"articleDone":false,"id":54},{"articleId":6,"articleCount":1,"articleDone":false,"id":55},{"articleId":7,"articleCount":0,"articleDone":false,"id":56},{"articleId":8,"articleCount":1,"articleDone":false,"id":57},{"articleId":9,"articleCount":0,"articleDone":false,"id":58}],"additionalRequest":"","phoneNumber":null,"deliveryComment":null,"city":null,"street":null,"number":null,"zipCode":null,"requesterId":6,"id":10,"created_at":"2020-03-23T01:54:54.200Z","priority":"low","status":"new","requester":{"street":null,"number":null,"zipCode":null,"city":null,"id":6,"firstName":"Andre","lastName":"Postman","email":"postman@andre.de","role":"none","telephone":null,"password":"e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e"}}
f10l commented

yep, problem with outdated data.

Will be solved with a new database deployment or PR #46

f10l commented

Done with the new deployment