Skip to content

Commit

Permalink
feat: add activeUserIndex to RotationUserDeleteDialog for user manage…
Browse files Browse the repository at this point in the history
…ment (#4260)
  • Loading branch information
mastercactapus authored Feb 3, 2025
1 parent 633184e commit 44e70b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions web/src/app/rotations/RotationUserDeleteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const query = gql`
rotation(id: $id) {
id
userIDs
activeUserIndex
users {
id
name
Expand Down Expand Up @@ -60,6 +61,10 @@ const RotationUserDeleteDialog = (props: {
userIDs: userIDs.filter(
(_: string, index: number) => index !== userIndex,
),
activeUserIndex:
userIndex < data.rotation.activeUserIndex
? data.rotation.activeUserIndex - 1
: data.rotation.activeUserIndex,
},
},
{ additionalTypenames: ['Rotation'] },
Expand Down

0 comments on commit 44e70b1

Please sign in to comment.