Skip to content
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

Defined markPostAsApproved function in /src/controllers/write/posts.js #46

Closed
wants to merge 0 commits into from

Conversation

Tasnim1147
Copy link

Added markPostAsApproved function in /src/controllers/write/posts.js

Changes made:

  • Implemented markPostAsApproved Function: Created a new asynchronous function markPostAsApproved that accepts a post ID (pid) and user ID (uid) as parameters. The function fetches the specified post from the database to verify its existence and retrieve necessary fields. Added functionality to set the isApproved property of the post to true, allowing posts to be marked as approved.

  • User Privilege Check: Placeholder comment added for a potential future check to verify whether the user is an administrator before allowing post approval. This ensures that only authorized users can approve posts.

  • Database Update: The updated post object is saved back to the database, ensuring the approval status is persistent and can be referenced later.

This PR resolves task TBD

@Tasnim1147 Tasnim1147 marked this pull request as draft October 9, 2024 01:48
@Tasnim1147 Tasnim1147 closed this Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant