feat(final-docs): judge review page + entry points
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -54,6 +54,20 @@ export const competitionRouter = router({
|
||||
return competition
|
||||
}),
|
||||
|
||||
/**
|
||||
* Resolve the id of the most-recent ACTIVE program for the logged-in user.
|
||||
* Used by client pages (e.g. the finalist-documents judge review) that need a
|
||||
* programId but don't have one in the route. Returns null when none is active.
|
||||
*/
|
||||
getActiveProgramId: protectedProcedure.query(async ({ ctx }) => {
|
||||
const program = await ctx.prisma.program.findFirst({
|
||||
where: { status: 'ACTIVE' },
|
||||
orderBy: { year: 'desc' },
|
||||
select: { id: true },
|
||||
})
|
||||
return program?.id ?? null
|
||||
}),
|
||||
|
||||
/**
|
||||
* Get competition by ID with rounds, jury groups, and submission windows
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user