fenya123 / forum123

Flask application written for educational purposes.
http://193.124.115.171/
1 stars 1 forks source link

Fix response for get post REST endpoint #153

Closed birthdaysgift closed 1 year ago

birthdaysgift commented 1 year ago

While working on adding REST endpoint to get post (#102), we added wrong response body:

return {
    "author_id": post.id,
    "created_at": str(post.created_at),
    "body": post.body,
    "topic_id": post.topic_id,
}

This body doesn't contain "id" and has a wrong value in "author_id".

So in the scope of this task we need to fix these two fields. "id" should contain a post id and "author_id" should contain id of the post author.