diff --git a/src/app/(main)/editor/[postId]/_components/post-editor.tsx b/src/app/(main)/editor/[postId]/_components/post-editor.tsx index 45fe7c3..f2986df 100644 --- a/src/app/(main)/editor/[postId]/_components/post-editor.tsx +++ b/src/app/(main)/editor/[postId]/_components/post-editor.tsx @@ -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; });