-
Notifications
You must be signed in to change notification settings - Fork 67
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
Feat: Admin managing posts feature added successfully issue 339 #406
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊 |
const user = await prisma.user.findFirst({ | ||
where: { | ||
id: userId, | ||
}, | ||
select: { | ||
isAdmin: true, | ||
}, | ||
}); | ||
|
||
if (!user?.isAdmin) { | ||
return res.status(403).json({ | ||
error: "User is not admin!", | ||
}); | ||
} | ||
|
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.
This user admin check is not needed since it is already done in isAdmin middleware
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.
@VaibhavArora314 I was also not doing this but I taught lets do like the user post contoller approach, My bad but i removed that check now 👍
@VaibhavArora314 can you add the label and level please ! |
🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀 |
@VaibhavArora314 @Ultimateutkarsh11 please add level 3 and GGSOC labels please 👍 |
Pull Request Resolves [#339 ]
Title: Admin managing posts feature added successfully.
Description
Related Issues
Fixes #339
Changes Made
New feature: Admin managing posts feature added.
Screenshots
Video
Style.Share._.Login.page.-.Google.Chrome.2024-07-10.02-21-23.online-video-cutter.com.mp4
I certify that I have carried out the relevant code of conduct and provided the requisite screenshot for validation by submitting this pull request.
Thank You for this contribution.