feat: show submission round file requirements on project edit page
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m40s
All checks were successful
Build and Push Docker Image / build (push) Successful in 9m40s
Adds a new tRPC procedure `round.getSubmissionRoundForProgram` that fetches the most recent SUBMISSION round for a given program, then displays any `requiredDocuments` from its configJson as labeled info cards above the general file upload section on the project edit page. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -861,4 +861,26 @@ export const roundRouter = router({
|
||||
orderBy: { sortOrder: 'asc' },
|
||||
})
|
||||
}),
|
||||
|
||||
/**
|
||||
* Get the most recent SUBMISSION round config for a program.
|
||||
* Used on the project edit page to show required document slots.
|
||||
*/
|
||||
getSubmissionRoundForProgram: adminProcedure
|
||||
.input(z.object({ programId: z.string() }))
|
||||
.query(async ({ ctx, input }) => {
|
||||
const round = await ctx.prisma.round.findFirst({
|
||||
where: {
|
||||
roundType: 'SUBMISSION',
|
||||
competition: { programId: input.programId },
|
||||
},
|
||||
select: {
|
||||
id: true,
|
||||
name: true,
|
||||
configJson: true,
|
||||
},
|
||||
orderBy: { sortOrder: 'desc' },
|
||||
})
|
||||
return round ?? null
|
||||
}),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user