mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-04-26 01:09:02 -05:00
22 lines
528 B
TypeScript
22 lines
528 B
TypeScript
import { sql } from "~/db/sql";
|
|
|
|
const deleteStm = sql.prepare(/* sql */ `
|
|
delete from "ReportedWeapon"
|
|
where "groupMatchMapId" = @groupMatchMapId
|
|
`);
|
|
|
|
const getGroupMatchMapsStm = sql.prepare(/* sql */ `
|
|
select "id" from "GroupMatchMap"
|
|
where "matchId" = @matchId
|
|
`);
|
|
|
|
export const deleteReporterWeaponsByMatchId = (matchId: number) => {
|
|
const groupMatchMaps = getGroupMatchMapsStm.all({ matchId }) as Array<{
|
|
id: number;
|
|
}>;
|
|
|
|
for (const { id } of groupMatchMaps) {
|
|
deleteStm.run({ groupMatchMapId: id });
|
|
}
|
|
};
|