mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 07:12:36 -05:00
Fix not being able to remove all owners of badges
This commit is contained in:
@@ -119,14 +119,16 @@ export function replaceOwners({
|
||||
.where("badgeId", "=", badgeId)
|
||||
.execute();
|
||||
|
||||
await trx
|
||||
.insertInto("TournamentBadgeOwner")
|
||||
.values(
|
||||
ownerIds.map((userId) => ({
|
||||
badgeId,
|
||||
userId,
|
||||
})),
|
||||
)
|
||||
.execute();
|
||||
if (ownerIds.length > 0) {
|
||||
await trx
|
||||
.insertInto("TournamentBadgeOwner")
|
||||
.values(
|
||||
ownerIds.map((userId) => ({
|
||||
badgeId,
|
||||
userId,
|
||||
})),
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user