Exported images w/ SQ season summary downloadable (#3272)

This commit is contained in:
Kalle
2026-07-31 17:34:49 +03:00
committed by GitHub
parent 83660a5b2f
commit 97619bdc05
114 changed files with 5780 additions and 292 deletions

View File

@@ -33,6 +33,21 @@ export function findIdByIdentifier(identifier: string) {
return userByIdentifierQuery(identifier).executeTakeFirst();
}
/** Country codes of the given users keyed by user id, users without a country set absent. */
export async function findCountriesByUserIds(userIds: number[]) {
if (userIds.length === 0) return new Map<number, string>();
const rows = await db
.selectFrom("User")
.select(["User.id", "User.country"])
.where("User.id", "in", userIds)
.where("User.country", "is not", null)
.$narrowType<{ country: NotNull }>()
.execute();
return new Map(rows.map((row) => [row.id, row.country]));
}
export async function findBuildFieldsByIdentifier(identifier: string) {
const row = await userByIdentifierQuery(identifier)
.select(({ eb }) => [