Migrate synxXPBadges function to Kysely
Some checks failed
E2E Tests / e2e (push) Has been cancelled
Tests and checks on push / run-checks-and-tests (push) Has been cancelled
Updates translation progress / update-translation-progress-issue (push) Has been cancelled

This commit is contained in:
Kalle
2026-01-29 22:13:50 +02:00
parent 31244b2d7c
commit 04c14e9cdf
7 changed files with 134 additions and 67 deletions

View File

@@ -1,10 +1,10 @@
import type { Transaction } from "kysely";
import { db, sql } from "~/db/sql";
import type { DB, Tables, TablesInsertable } from "~/db/tables";
import * as BadgeRepository from "~/features/badges/BadgeRepository.server";
import * as BuildRepository from "~/features/builds/BuildRepository.server";
import { dateToDatabaseTimestamp } from "~/utils/dates";
import invariant from "~/utils/invariant";
import { syncXPBadges } from "../badges/queries/syncXPBadges.server";
const removeOldLikesStm = sql.prepare(/*sql*/ `
delete from
@@ -239,7 +239,7 @@ export async function linkUserAndPlayer({
.where("SplatoonPlayer.id", "=", playerId)
.execute();
syncXPBadges();
await BadgeRepository.syncXPBadges();
await BuildRepository.recalculateAllTop500();
}