Skip to content

Commit

Permalink
chore(user): refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
oyvindgrutle committed Jul 16, 2024
1 parent 36bce9a commit fa1b1e7
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ 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) {
if (!org.id) return
deleteOrganization(org.id)
}
}),
).then(deleteUserBoards)
)
} catch (error) {
return getFormFeedbackForError()
}
Expand Down

0 comments on commit fa1b1e7

Please sign in to comment.