Skip to content

Commit 0d9ef3a

Browse files
committed
fix(evidence-forms): add validation for submission status before review
1 parent 338a924 commit 0d9ef3a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

apps/api/src/evidence-forms/evidence-forms.service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,12 @@ export class EvidenceFormsService {
530530
throw new NotFoundException('Submission not found');
531531
}
532532

533+
if (submission.status !== 'pending') {
534+
throw new BadRequestException(
535+
'Submission must be pending to be reviewed',
536+
);
537+
}
538+
533539
return await db.evidenceSubmission.update({
534540
where: { id: params.submissionId },
535541
data: {

0 commit comments

Comments
 (0)