Comment Delete
/api/v2/feed/comment/delete
Post
posts
profiles
groups
jwt
Purpose
To allow a user to delete one of his/her existing comments on a post.
Body Content [input]
{
    uid: string,
    postID: string,
    commentID: string
}
Returns if valid [output]
{
    message: string,
    error: 0
}
What the API does
- Finds the 
profilecorresponding to theuidpassed and fetches a list of all values inside of thefollowingandblockedfields. - Finds the record from the 
postscollection having apostIDcorresponding to the one passed [404]. - Ensures that the record found does not have a value for its 
visibilityfield set tonone[403]. - If the record does not have a 
visibilityofnone,followersorpublic, fetch themembersfield of theAccessGroupcorresponding to the value of thevisibilityfield and ensures thatuidis among the values of thatmembersfield [403]. - If the record has a value for its 
groupIDfield, find thegroupcorresponding to thatgroupIDand check ifuidis a value among thatgroup’smembersfield with astatusofaccepted[403]. - Ensures that the record’s 
uidfield does not equal to a value among those of the fetchedblockedfield above [403]. - Ensures that the 
profilethat has auidcorresponding to that of the record does not contain a value corresponding to theuidpassed in itsblockedfield [403]. - Else, if the record does not have a value for its 
groupIDfield, and has a value offollowersfor its visibility field check ifuidis among the values of thefollowingfield or if it is equal to theuidof thepostitself [403]. - Checks that there is a 
commentcorresponding to the value of thecommentIDfield passed inside of thatpost’scommentsfield [404]. - Ensures that the found 
commenthas the sameuidas that passed or thatuidcorresponds to that of thepost[403]. - Deletes the object inside of that 
post’scommentsfield corresponding to thecommentIDpassed and saves. - Loops through all the objects inside of that 
post’scommentsfield and deletes each of them that directly or indirectly refer to the value ofcommentIDin theirreply_tofield.