'Edit Post' Documentation - bounswe/2021SpringGroup7 GitHub Wiki
It performs editing post action for the user. It takes username and post id as path parameters and a json object containing post attributes that is requested to be edited. It updates the given attributes of the given post in the database.
These parameters are taken in the URL.
postId:integer -> id of the post that is requested to be viewed
ownerUsername:string -> username of the user that requested edit action
These parameters are taken in json body.
location:string (not required)
multimedia:array of strings (not required)
story:string (not required)
storyDate:object (not required)
tags:list of strings (not required)
topic:string (not required)
HTTP 200: Returns ‘Successful Edit’ indicating that the post is updated in the database as requested.
- Example Response
Successful Edit
- Example Response
{
"error": "User who requested post edit not found"
}
{
"error": "Post not found"
}
- Example Response
{
"error": "This user is not authorized to edit this post"
}
- Example Response
{
"error": "postDate does not exist or cannot be edited"
}