bcanfield/nexquik

Creating an entity from the list page does not always correctly invalidate the cache

Closed this issue · 3 comments

Creating an entity from the list page does not always correctly invalidate the cache

I'm not sure if I understood this bug correctly, but I noticed in my use that when creating the user I am redirected to the user's detail, then if I click to return to the list page, the list is not updated with the last user created.

In order to try to help, what I did to update the list is in the following code:

async function backToUserListPage() {
    "use server";
    revalidatePath(`/user`);
    redirect(`/user`);
  }
 <form>
    <div className="button-group">
       <button formAction={backToUserListPage} className="base-link">
            Back
       </button>
    </div>
 </form>

note: I don't know if it's the best practice, but at least apparently it worked here.

Thank you for the response! Taking a look now

Issue has been resolved