From fa1b1e731de7ed325a6f38657b29416574002a96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Grutle?= Date: Tue, 16 Jul 2024 13:01:37 +0200 Subject: [PATCH] chore(user): refactor --- next-tavla/app/(admin)/components/Footer/components/actions.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/next-tavla/app/(admin)/components/Footer/components/actions.ts b/next-tavla/app/(admin)/components/Footer/components/actions.ts index c851a7b9e..1677e30af 100644 --- a/next-tavla/app/(admin)/components/Footer/components/actions.ts +++ b/next-tavla/app/(admin)/components/Footer/components/actions.ts @@ -43,6 +43,7 @@ async function deleteUserBoardsAndOrganizations(uid: TUserID) { try { const organizations = await getOrganizationsForUser() + await deleteUserBoards() return Promise.all( organizations.map((org) => { if (org.owners?.includes(uid) && org.owners.length < 2) { @@ -50,7 +51,7 @@ async function deleteUserBoardsAndOrganizations(uid: TUserID) { deleteOrganization(org.id) } }), - ).then(deleteUserBoards) + ) } catch (error) { return getFormFeedbackForError() }