Delete
/api/v2/story/delete
Post
stories
jwt
Purpose
To allow a user to delete a story that he/she has posted.
Body Content [input]
{
uid: string,
storyID: string
}
Returns if valid [output]
{
message: string,
error: 0
}
What the API does
- Finds the
story
records from thestories
collection corresponding to thestoryID
passed. - Ensures that that
story
record has the same value for itsuid
field as that passed. - Checks that the current day / time minus the value of the
posted_on
field of thatstory
record is less than 24 hours [403]. - Deletes the record from the
stories
collection corresponding to the value of thestoryID
field passed.