fix strike query
This commit is contained in:
@ -3,7 +3,6 @@ import { strikeReason } from '@db/schema/strikeReason.ts';
|
|||||||
import type { MySql2Database } from 'drizzle-orm/mysql2';
|
import type { MySql2Database } from 'drizzle-orm/mysql2';
|
||||||
import { eq } from 'drizzle-orm';
|
import { eq } from 'drizzle-orm';
|
||||||
import { report } from '@db/schema/report.ts';
|
import { report } from '@db/schema/report.ts';
|
||||||
import { reportStatus } from '@db/schema/reportStatus.ts';
|
|
||||||
|
|
||||||
type Database = MySql2Database<{ strike: typeof strike }>;
|
type Database = MySql2Database<{ strike: typeof strike }>;
|
||||||
|
|
||||||
@ -52,6 +51,6 @@ export async function getStrikesByTeamId(db: Database, values: GetStrikesByTeamI
|
|||||||
})
|
})
|
||||||
.from(strike)
|
.from(strike)
|
||||||
.innerJoin(strikeReason, eq(strike.strikeReasonId, strikeReason.id))
|
.innerJoin(strikeReason, eq(strike.strikeReasonId, strikeReason.id))
|
||||||
.innerJoin(report, eq(reportStatus.reportId, report.id))
|
.innerJoin(report, eq(strike.reportId, report.id))
|
||||||
.where(eq(report.reportedTeamId, values.teamId));
|
.where(eq(report.reportedTeamId, values.teamId));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user