-
Notifications
You must be signed in to change notification settings - Fork 0
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
Publish blog posts 464 #473
base: staging
Are you sure you want to change the base?
Conversation
…or content managers or admins based on who is logged in. Admins now have the ability to publish blogs. Additionally, the status for API data has been changed to "Draft" because the API was returning an undefined status for fetched data. I believe this issue needs to be addressed by the backend team.
… allows publishing blogs in Draft or InReview status.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…h now allows publishing blogs in Draft or InReview status.
… with the existing enum UserRole, and this impacts the entire project. Additionally, the use of ENDPOINTS for API data has been implemented, and the method of fetching data has been changed to using useMutation from react-query
…UpdatePostStatus.ts and integrating it into the PublishArticleForm.tsx
@aleksandarmicev Can you please go though the comments above. If anything is already done, click on Resolve Conversation. If the PR is ready to be rechecked please rerequest a review by clicking on the red icon next to my name in Reviews on top right |
Thank you for your comments. |
|
||
const PostArticle = () => { | ||
const { data: session } = useSession(); | ||
|
||
// console.log('Session data:', session); |
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.
remove console.log
const handleAddPost = (values: NewPost) => { | ||
addNewPostMutation.mutate(values); |
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.
why is handleAddPost deleted?
return ( | ||
<div className={styles.container}> | ||
<h2>Објави статија</h2> | ||
|
||
<div className={styles.controlsContainer}> | ||
<PublishArticleForm /> | ||
<PublishArticleForm userRole={userRole} /> |
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 main purpose of the create blog page should be to create/add new blog. On create we should call this endpoint: https://api.learnhub.mk/docs/#content-POSTcontent-blog-posts
We can change the status of already created blogs. That is why you need to send the id of the blog.
Whit this PR, we made changes to include a draft status, providing different options for content managers or admins based on who is logged in.
Admins now have the ability to publish blogs. Additionally, the status for API data has been changed to "Draft" because the API was returning an undefined status for fetched data. I believe this issue needs to be addressed by the backend team.