NuxtN
Nuxt15mo ago
-

[resolved] How would you implement showing a success message after posting a form?

I have this use case:
  1. User navigate to
    /books/create
    which displays a form to create a book
  2. User fills the from and submits the form
  3. In case of a successful submit, the user gets redirected to
    /books/:id
    and a success message is shown at the top.
Now, I'm not sure how to show the success message and make sure it's only shown once. E.g. it shouldn't appear again when page is refreshed.

I'm thinking about using
sessionStorage
or just simply redirect to
/books/:id?success=true
and then somehow omit the
success
query param.

What do you think? Are there existing solutions that solve this problem?
Was this page helpful?