Building up on setting up the ability for posts to be flagged as inappropriate, we would like an admin to be able to see flagged posts to be able to take action on them.
Technical Considerations
We will be allowing the existing /feed endpoint to take an isFlagged parameter which could either be false or true. For example, /feed?isFlagged=true
The already existing/feed endpoint without the isFlagged query param is allowed to all authenticated users.
Adding the isFlagged query parameter to the /feed endpoint is only accessible for admin users. That is, if the feed endpoint is called and has the isFlagged parameter, we should ensure the authenticated user is an admin. If they are not an admin, we return an unauthorized response.
What counts as a flagged post? A flagged post is one which has a flagsCount of at least 1. This means we will be fetching such posts when the isFlagged query param is passed as true. If it is false, we fetch posts with flagsCount of 0
Task Description
Building up on setting up the ability for posts to be flagged as inappropriate, we would like an admin to be able to see flagged posts to be able to take action on them.
Technical Considerations
/feed
endpoint to take anisFlagged
parameter which could either befalse
ortrue
. For example,/feed?isFlagged=true
/feed
endpoint without theisFlagged
query param is allowed to all authenticated users.isFlagged
query parameter to the/feed
endpoint is only accessible for admin users. That is, if the feed endpoint is called and has theisFlagged
parameter, we should ensure the authenticated user is an admin. If they are not an admin, we return an unauthorized response.flagsCount
of at least 1. This means we will be fetching such posts when theisFlagged
query param is passed astrue
. If it isfalse
, we fetch posts with flagsCount of0