mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-09 04:36:02 -05:00
User card (#3213)
This commit is contained in:
@@ -1140,6 +1140,23 @@ export function updateOwnProfile(args: UpdateProfileArgs) {
|
||||
});
|
||||
}
|
||||
|
||||
/** Bulk-sets each user's latest LUTI division. Used by the `ComputeLutiDivs` routine. */
|
||||
export function updateManyDivs(
|
||||
updates: Array<{ userId: number; div: string }>,
|
||||
) {
|
||||
if (updates.length === 0) return;
|
||||
|
||||
return db.transaction().execute(async (trx) => {
|
||||
for (const { userId, div } of updates) {
|
||||
await trx
|
||||
.updateTable("User")
|
||||
.set({ div })
|
||||
.where("id", "=", userId)
|
||||
.execute();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function updateOwnCustomTheme(css: CustomTheme | null) {
|
||||
return db
|
||||
.updateTable("User")
|
||||
|
||||
Reference in New Issue
Block a user