Skip to content

Commit

Permalink
Overall fixes, read the comment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fr3akyMurk committed Feb 27, 2024
1 parent 33fafd9 commit af6c1a2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/app/(main)/editor/[postId]/_components/post-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ export const PostEditor = ({ post, user }: Props) => {
const onSubmit = form.handleSubmit(async (values) => {
if (user.id == post.userId) {
updatePost.mutate({ id: post.id, ...values });
toast('Saved the post successfully.');
return;
}
if (!user) {
toast('You need to log in to edit this post.');
return;
}

toast('You do not have permission to edit this post.');
return;
});
Expand Down

0 comments on commit af6c1a2

Please sign in to comment.