Handout management
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
||||
Body,
|
||||
Controller,
|
||||
Get,
|
||||
Param,
|
||||
Post,
|
||||
Put,
|
||||
Req,
|
||||
@@ -12,6 +13,7 @@ import { AuthenticatedRequest } from 'src/model/interface/authenticated-request.
|
||||
import { AuthGuard } from 'src/core/guards/auth.guard';
|
||||
import { Key } from 'src/model/entitites';
|
||||
import { CreateKeySystemDto } from 'src/model/dto/create-key-system.dto';
|
||||
import { HandoverKeyDto } from 'src/model/dto';
|
||||
|
||||
@UseGuards(AuthGuard)
|
||||
@Controller('key')
|
||||
@@ -34,7 +36,24 @@ export class KeyController {
|
||||
}
|
||||
|
||||
@Post('system')
|
||||
createKeySystem(@Req() req: AuthenticatedRequest, @Body() body: CreateKeySystemDto) {
|
||||
createKeySystem(
|
||||
@Req() req: AuthenticatedRequest,
|
||||
@Body() body: CreateKeySystemDto,
|
||||
) {
|
||||
return this.service.createKeySystem(req.user, body);
|
||||
}
|
||||
|
||||
@Post(':id/handover')
|
||||
handoutKey(
|
||||
@Req() req: AuthenticatedRequest,
|
||||
@Body() body: any,
|
||||
@Param('id') id: string,
|
||||
) {
|
||||
return this.service.handoverKey(req.user, body, id);
|
||||
}
|
||||
|
||||
@Get(':id/handover')
|
||||
getKeyHandouts(@Req() req: AuthenticatedRequest, @Param('id') id: string) {
|
||||
return this.service.getKeyHandovers(req.user, id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user