-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#167129854 Fetch all blocked articles #71
Conversation
51514a6
to
b7ebb17
Compare
*/ | ||
static async getBlockedArticles(req, res) { | ||
const blockedArticles = await BlockedArticles.findAll({}); | ||
return res.status(200).json({ status: 200, data: blockedArticles || [] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It returns an empty array by default, in case there is no blocked article.
*/ | ||
static async getReportedArticles(req, res) { | ||
const reportedArticles = await ReportedArticles.findAll({}); | ||
return res.status(200).json({ status: 200, data: reportedArticles || [] }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same here.
- get all reported articles - get all blocked articles
b7ebb17
to
00dea73
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
- get all reported articles - get all blocked articles
What does this PR do?
Admin or moderator can fetch blocked and reported articles
Description of Task to be completed?
Have the following endpoints working:
GET - /api/articles/blocked/all
GET - /api/articles/reported/all
How should this be manually tested?
This PR can be tested using Postman after checking into this branch
Any background context you want to provide?
N/A
What are the relevant pivotal tracker stories?
#167129854 #167151057
Screenshots (if appropriate)
N/A
Questions:
N/A