Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update method in post service #395

Open
camelya58 opened this issue Sep 8, 2020 · 1 comment
Open

Fix update method in post service #395

camelya58 opened this issue Sep 8, 2020 · 1 comment

Comments

@camelya58
Copy link
Member

Please, fix code in update method of PostServiceRealization class.
When you try in swagger to update some post, for example, with id "5f390c7e810fe1a026e7f80", which doesn't exist in repository, you receive incorrect response.
Request:

curl -X PUT "http://post-reckue.apps.us-east-1.starter.openshift-online.com/posts/5f390c7e810fe1a026e7f80" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"nodes\": [ { \"node\": { \"type\": \"TEXT\" }, \"postId\": \"string\", \"source\": \"string\", \"type\": \"TEXT\", \"userId\": \"string\" } ], \"source\": \"string\", \"status\": \"DRAFT\", \"tags\": [ { \"id\": \"string\", \"name\": \"string\" } ], \"title\": \"string\", \"userId\": \"string\"}"

Expected response:
404 Not Found

{
  "title": "PostNotFoundException",
  "message": "Post by id '5f390c7e810fe1a026e7f80' is not found",
  "code": "RPE-001",
  "trace": "com.reckue.post.exceptions.models.post.PostNotFoundException: Post by id '5f390c7e810fe1a026e7f80' is not found..."
}

Actual response:
505 Internal Server Error

{
  "timestamp": "2020-09-08T20:03:17.714+0000",
  "status": 500,
  "error": "Internal Server Error",
  "message": "No value present",
  "path": "/posts/5f390c7e810fe1a026e7f80"
}
@camelya58
Copy link
Member Author

When you fix it, please describe it in already existed docs.

@mamadaliev mamadaliev assigned lmaridae and unassigned Marina2302 Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants