diff --git a/docs/tutorials/essentials/part-8-rtk-query-advanced.md b/docs/tutorials/essentials/part-8-rtk-query-advanced.md index a818ab91b8..a929a39909 100644 --- a/docs/tutorials/essentials/part-8-rtk-query-advanced.md +++ b/docs/tutorials/essentials/part-8-rtk-query-advanced.md @@ -130,9 +130,13 @@ export const EditPostForm = () => { const content = elements.postContent.value if (title && content) { - // highlight-next-line - await updatePost({ id: post.id, title, content }) - navigate(`/posts/${postId}`) + try { + // highlight-next-line + await updatePost({ id: post.id, title, content }).unwrap() + navigate(`/posts/${postId}`) + } catch (err) { + console.error('Failed to save the post: ', err) + } } }