mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 15:17:43 -05:00
Fix crash when editing profile
This commit is contained in:
@@ -343,17 +343,19 @@ export function updateProfile(args: UpdateProfileArgs) {
|
||||
.where("userId", "=", args.userId)
|
||||
.execute();
|
||||
|
||||
await trx
|
||||
.insertInto("UserWeapon")
|
||||
.values(
|
||||
args.weapons.map((weapon, i) => ({
|
||||
userId: args.userId,
|
||||
weaponSplId: weapon.weaponSplId,
|
||||
isFavorite: weapon.isFavorite,
|
||||
order: i + 1,
|
||||
})),
|
||||
)
|
||||
.execute();
|
||||
if (args.weapons.length > 0) {
|
||||
await trx
|
||||
.insertInto("UserWeapon")
|
||||
.values(
|
||||
args.weapons.map((weapon, i) => ({
|
||||
userId: args.userId,
|
||||
weaponSplId: weapon.weaponSplId,
|
||||
isFavorite: weapon.isFavorite,
|
||||
order: i + 1,
|
||||
})),
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
|
||||
return trx
|
||||
.updateTable("User")
|
||||
|
||||
Reference in New Issue
Block a user