From b25e6f8ad1256b5556cfc7623064a6fd42b299fb Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Tue, 30 Apr 2024 13:03:51 +0100 Subject: [PATCH] fix: edit group (#3856) Co-authored-by: kyle-ssg --- frontend/common/services/useGroup.ts | 16 +++++++++++++--- frontend/web/components/UserGroupList.tsx | 5 ++++- frontend/web/components/modals/CreateGroup.tsx | 5 +---- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/frontend/common/services/useGroup.ts b/frontend/common/services/useGroup.ts index f969fe07be00..46c9f76bf81a 100644 --- a/frontend/common/services/useGroup.ts +++ b/frontend/common/services/useGroup.ts @@ -11,7 +11,10 @@ export const groupService = service .injectEndpoints({ endpoints: (builder) => ({ createGroup: builder.mutation({ - invalidatesTags: [{ id: 'LIST', type: 'Group' }], + invalidatesTags: [ + { id: 'LIST', type: 'Group' }, + { type: 'GroupSummary' }, + ], queryFn: async (query, { dispatch }, _, baseQuery) => { //Create the group const { data, error } = await baseQuery({ @@ -47,7 +50,10 @@ export const groupService = service Res['groupAdmin'], Req['createGroupAdmin'] >({ - invalidatesTags: [{ id: 'LIST', type: 'Group' }], + invalidatesTags: [ + { id: 'LIST', type: 'Group' }, + { type: 'GroupSummary' }, + ], query: (query: Req['createGroupAdmin']) => ({ body: {}, method: 'POST', @@ -70,7 +76,10 @@ export const groupService = service Res['groupAdmin'], Req['deleteGroupAdmin'] >({ - invalidatesTags: [{ id: 'LIST', type: 'Group' }], + invalidatesTags: [ + { id: 'LIST', type: 'Group' }, + { type: 'GroupSummary' }, + ], query: (query: Req['deleteGroupAdmin']) => ({ body: {}, method: 'POST', @@ -93,6 +102,7 @@ export const groupService = service invalidatesTags: (res) => [ { id: 'LIST', type: 'Group' }, { id: res?.id, type: 'Group' }, + { type: 'GroupSummary' }, ], queryFn: async (query, { dispatch }, _, baseQuery) => { //Create the group diff --git a/frontend/web/components/UserGroupList.tsx b/frontend/web/components/UserGroupList.tsx index f51afd1187a9..24ba6466f0af 100644 --- a/frontend/web/components/UserGroupList.tsx +++ b/frontend/web/components/UserGroupList.tsx @@ -110,7 +110,10 @@ const UserGroupsRow: FC = ({