Skip to content

Commit

Permalink
fix: process list with groups when deleting member
Browse files Browse the repository at this point in the history
  • Loading branch information
Draconizations committed Oct 4, 2024
1 parent 2fbcec3 commit 6a320b1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/components/dash/edit/DeleteButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
type,
asPage,
list,
groupList,
}: {
item: Member | Group
type: "member" | "group"
asPage: boolean
list: DashList<Member | Group>
groupList: DashList<Group>
} = $props()
let element: HTMLDialogElement
Expand All @@ -35,7 +37,7 @@
if (!asPage) {
list.list.raw = list.list.raw.filter((g) => g.uuid !== item.uuid)
list.process()
list.process(groupList.list.raw)
list.paginate()
} else {
goto(`/dash/${dash.user?.id}?tab=${type}s`)
Expand Down
2 changes: 1 addition & 1 deletion src/components/dash/groups/edit/GroupInfoEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -222,5 +222,5 @@
</button>
{/if}
</div>
<DeleteButton type="group" item={group} {asPage} {list} />
<DeleteButton type="group" item={group} {asPage} {list} groupList={list} />
</div>
2 changes: 1 addition & 1 deletion src/components/dash/groups/edit/GroupMemberEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@
</button>
{/if}
</div>
<DeleteButton type="group" item={group} {asPage} list={groupList} />
<DeleteButton type="group" item={group} {asPage} list={groupList} {groupList} />
</div>

{#snippet option(opt: any)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/dash/groups/edit/GroupViewEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,5 @@
</button>
{/if}
</div>
<DeleteButton type="group" item={group} {asPage} {list} />
<DeleteButton type="group" item={group} {asPage} {list} groupList={list} />
</div>
2 changes: 1 addition & 1 deletion src/components/dash/members/edit/MemberGroupEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@
</button>
{/if}
</div>
<DeleteButton type="member" item={member} {asPage} list={memberList} />
<DeleteButton type="member" item={member} {asPage} list={memberList} {groupList} />
</div>

{#snippet option(opt: any)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/dash/members/edit/MemberInfoEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -320,5 +320,5 @@
</button>
{/if}
</div>
<DeleteButton type="member" item={member} {asPage} {list} />
<DeleteButton type="member" item={member} {asPage} {list} {groupList} />
</div>
2 changes: 1 addition & 1 deletion src/components/dash/members/edit/MemberViewEdit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,5 @@
</button>
{/if}
</div>
<DeleteButton type="member" item={member} {asPage} {list} />
<DeleteButton type="member" item={member} {asPage} {list} {groupList} />
</div>

0 comments on commit 6a320b1

Please sign in to comment.