Skip to content

Commit e437348

Browse files
committed
test: add delete by subject id in instrument records service
1 parent 4726227 commit e437348

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

apps/api/src/instrument-records/instrument-records.controller.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,17 @@ export class InstrumentRecordsController {
6060
await this.instrumentRecordsService.deleteById(id, { ability });
6161
}
6262

63+
@ApiOperation({ summary: 'Delete by Subject' })
64+
@Delete('bySubject/:subjectId')
65+
@HttpCode(HttpStatus.NO_CONTENT)
66+
@RouteAccess({ action: 'delete', subject: 'InstrumentRecord' })
67+
async deleteBySubjectId(
68+
@Param('subjectId', ValidObjectIdPipe) subjectId: string,
69+
@CurrentUser('ability') ability: AppAbility
70+
) {
71+
await this.instrumentRecordsService.deleteById(subjectId, { ability });
72+
}
73+
6374
@ApiOperation({ summary: 'Export Records' })
6475
@Get('export')
6576
@RouteAccess({ action: 'read', subject: 'InstrumentRecord' })

0 commit comments

Comments
 (0)