From 34a7ae1ddaeb239739c02acf1d2ecbf96e71baf0 Mon Sep 17 00:00:00 2001 From: z1glr Date: Wed, 29 Jan 2025 22:23:34 +0000 Subject: [PATCH] fixed users not reloading after adding / deleting / editing --- client/src/app/admin/(users)/Users.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/client/src/app/admin/(users)/Users.tsx b/client/src/app/admin/(users)/Users.tsx index fa61ce4..72b17fc 100644 --- a/client/src/app/admin/(users)/Users.tsx +++ b/client/src/app/admin/(users)/Users.tsx @@ -65,6 +65,9 @@ export default function Users() { }); if (result.ok) { + // clear the users first from the zustand + zustand.getState().patch({ users: undefined }); + users.reload(); setDeleteUser(undefined); } @@ -158,6 +161,10 @@ export default function Users() { onOpenChange={setShowAddUser} onSuccess={() => { setShowAddUser(false); + + // clear the users first from the zustand + zustand.getState().patch({ users: undefined }); + users.reload(); }} /> @@ -169,6 +176,10 @@ export default function Users() { } onSuccess={() => { users.reload(); + + // clear the users first from the zustand + zustand.getState().patch({ users: undefined }); + setEditUser(undefined); }} />