Skip to content

Commit 9bcec91

Browse files
committed
fix build
1 parent fdf2b24 commit 9bcec91

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

packages/api/src/router/scouting.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ export const scoutingRouter = createTRPCRouter({
2525
z.object({ event: z.string(), assignee: z.string().uuid().optional() }),
2626
)
2727
.query(async ({ ctx, input }) => {
28-
const { data, error } = await ctx.supabase
28+
let query = ctx.supabase
2929
.from("assignments")
3030
.select(
3131
"matches (key, event, events (key, name)), team, alliance, assignee",
3232
)
33-
.eq("matches.event", input.event)
34-
.eq("assignee", input?.assignee === undefined ? null : input.assignee);
33+
.eq("matches.event", input.event);
34+
if (input?.assignee === undefined) {
35+
query = query.is("assignee", null);
36+
} else {
37+
query = query.eq("assignee", input.assignee);
38+
}
39+
const { data, error } = await query;
3540
console.log(data, input.event);
3641
if (error !== null || data === null) {
3742
throw new TRPCError({

0 commit comments

Comments
 (0)