Skip to content

Commit 8a05774

Browse files
committed
add doc to duplicateAudit()
1 parent 4cb35a0 commit 8a05774

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

confiture-rest-api/src/audits/audits.controller.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,18 @@ export class AuditsController {
216216
}
217217
}
218218

219+
/** Fully duplicate an audit. This includes
220+
* - the audit metadata (procedure name, auditor name, etc)
221+
* - the audited pages
222+
* - the RGAA results (status, comment, user impact)
223+
* - the example images
224+
*/
219225
@Post('/:uniqueId/duplicate')
226+
@ApiCreatedResponse({
227+
description: 'The audit has been successfully duplicated.',
228+
})
229+
@ApiNotFoundResponse({ description: 'The audit does not exist.' })
230+
@ApiGoneResponse({ description: 'The audit has been previously deleted.' })
220231
async duplicateAudit(
221232
@Param('uniqueId') uniqueId: string,
222233
@Body() body: DuplicateAuditDto,
@@ -226,7 +237,9 @@ export class AuditsController {
226237
body.procedureName,
227238
);
228239

229-
// TODO check if newAuditId is defined
240+
if (!newAuditId) {
241+
return this.sendAuditNotFoundStatus(uniqueId);
242+
}
230243

231244
return newAuditId;
232245
}

0 commit comments

Comments
 (0)