Skip to content

Commit

Permalink
refactor(dashboard): refactor getAssociatedGroup
Browse files Browse the repository at this point in the history
  • Loading branch information
waddaboo committed Oct 24, 2024
1 parent d7b03e2 commit 033d585
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions apps/dashboard/src/api/semaphoreAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,29 +78,19 @@ export async function getAssociatedGroup(
members: true
})

const members = group.members as string[]
const bandadaGroup = await getGroupByName(group.id)

if (bandadaGroup && bandadaGroup.length > 0) {
const members = group.members as string[]
members.push(...bandadaGroup[0].members)

return {
id: group.id,
name: parseGroupName(group.id),
treeDepth: group.merkleTree.depth,
fingerprintDuration: 3600,
members,
admin: group.admin as string,
type: "on-chain"
}
}

return {
id: group.id,
name: parseGroupName(group.id),
treeDepth: group.merkleTree.depth,
fingerprintDuration: 3600,
members: group.members as string[],
members,
admin: group.admin as string,
type: "on-chain"
}
Expand Down

0 comments on commit 033d585

Please sign in to comment.