forked from Yara724/api
Removed the guard of accidentWay
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { extname } from "node:path";
|
||||
import {
|
||||
BadRequestException,
|
||||
Body,
|
||||
Controller,
|
||||
Param,
|
||||
@@ -362,20 +361,6 @@ export class ExpertInitiatedBlameMirrorController {
|
||||
@CurrentUser() expert: any,
|
||||
@UploadedFile() sign: Express.Multer.File,
|
||||
) {
|
||||
// Guard: accident fields (accidentWay, etc.) must be filled before signing.
|
||||
// This prevents the expert from bypassing add-accident-fields and avoids the
|
||||
// double-sign bug where add-accident-fields re-enters WAITING_FOR_SIGNATURES
|
||||
// after a signature was already recorded.
|
||||
const requestData = await this.requestManagementService.getBlameRequestV2(
|
||||
requestId,
|
||||
expert,
|
||||
);
|
||||
if (!(requestData?.expert?.decision as any)?.fields?.accidentWay) {
|
||||
throw new BadRequestException(
|
||||
"Accident fields (accidentWay, accidentReason, accidentType) must be submitted via add-accident-fields before signing.",
|
||||
);
|
||||
}
|
||||
|
||||
await this.mediaPolicyService.assertForBlame(sign, requestId, "image");
|
||||
const partyRole =
|
||||
body?.partyRole === "SECOND" ? PartyRole.SECOND : PartyRole.FIRST;
|
||||
|
||||
Reference in New Issue
Block a user