From dd7680769f5122db2569347982d9d83289d2f094 Mon Sep 17 00:00:00 2001 From: Felix Thape Date: Sat, 5 Aug 2023 19:16:50 +0200 Subject: [PATCH] fix: fix OrganizationDetails showing wrong data and endlessly loading invites --- .../components/OrganisationInvitationList.tsx | 4 +- .../components/layout/OrganizationDetails.tsx | 101 +++++++++--------- tasks/mutations/organization_mutations.ts | 2 +- 3 files changed, 55 insertions(+), 52 deletions(-) diff --git a/tasks/components/OrganisationInvitationList.tsx b/tasks/components/OrganisationInvitationList.tsx index 320381ad..2cbac1b2 100644 --- a/tasks/components/OrganisationInvitationList.tsx +++ b/tasks/components/OrganisationInvitationList.tsx @@ -89,8 +89,8 @@ export const OrganisationInvitationList = ({ return ( diff --git a/tasks/components/layout/OrganizationDetails.tsx b/tasks/components/layout/OrganizationDetails.tsx index 53f86f93..82ff8246 100644 --- a/tasks/components/layout/OrganizationDetails.tsx +++ b/tasks/components/layout/OrganizationDetails.tsx @@ -108,58 +108,61 @@ export const OrganizationDetail = ({ })) return ( -
- setIsShowingConfirmDialog(false)} - onBackgroundClick={() => setIsShowingConfirmDialog(false)} - onConfirm={() => { - setIsShowingConfirmDialog(false) - deleteMutation.mutate(contextState.organizationID) - }} - confirmType="negative" - /> - -
- { - setOrganizationForm(organizationForm) - if (shouldUpdate) { - updateMutation.mutate(organizationForm.organization) - } +
+ setIsShowingConfirmDialog(false)} + onBackgroundClick={() => setIsShowingConfirmDialog(false)} + onConfirm={() => { + setIsShowingConfirmDialog(false) + deleteMutation.mutate(contextState.organizationID) }} + confirmType="negative" /> - {!isCreatingNewOrganization && ( - - )} - -
- -
-
- {translation.dangerZone} - {translation.dangerZoneText} - + +
+ { + setOrganizationForm(organizationForm) + if (shouldUpdate) { + updateMutation.mutate(organizationForm.organization) + } + }} + /> + {!isCreatingNewOrganization && ( + + )} + +
+ +
+
+ {translation.dangerZone} + {translation.dangerZoneText} + +
-
) } diff --git a/tasks/mutations/organization_mutations.ts b/tasks/mutations/organization_mutations.ts index f1f288f8..d38681d8 100644 --- a/tasks/mutations/organization_mutations.ts +++ b/tasks/mutations/organization_mutations.ts @@ -345,9 +345,9 @@ export const useInviteMemberMutation = (organizationID: string, callback: (invit const res = await organizationService.inviteMember(req, getAuthenticatedGrpcMetadata()) if (!res.getId()) { - // TODO some check whether request was successful console.error('InviteMember failed') } + callback(res.getId()) return res.toObject() },