File tree Expand file tree Collapse file tree
confiture-rest-api/src/audits Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments