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

Publish blog posts 464 #473

Open
wants to merge 10 commits into
base: staging
Choose a base branch
from
Open

Conversation

aleksandarmicev
Copy link
Contributor

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.

…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.
Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 25, 2024 5:07pm

@aleksandarmicev aleksandarmicev linked an issue Dec 16, 2024 that may be closed by this pull request
…h now allows publishing blogs in Draft or InReview status.
app/content-panel/blogs/create/page.tsx Outdated Show resolved Hide resolved
app/content-panel/blogs/create/page.tsx Outdated Show resolved Hide resolved
components/module-components/blog/PublishArticleForm.tsx Outdated Show resolved Hide resolved
components/module-components/blog/PublishArticleForm.tsx Outdated Show resolved Hide resolved
components/module-components/create-blogs/BlogListView.tsx Outdated Show resolved Hide resolved
components/module-components/create-blogs/BlogListView.tsx Outdated Show resolved Hide resolved
components/module-components/create-blogs/BlogListView.tsx Outdated Show resolved Hide resolved
components/module-components/create-blogs/BlogListView.tsx Outdated Show resolved Hide resolved
… 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
@edichoska
Copy link
Contributor

@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

@aleksandarmicev
Copy link
Contributor Author

@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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove console.log

Comment on lines -31 to -32
const handleAddPost = (values: NewPost) => {
addNewPostMutation.mutate(values);
Copy link
Contributor

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} />
Copy link
Contributor

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.

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.

[FE] Content-Panel: Publish Blog Posts
2 participants