refactor(server): send job command (#2777)

* refactor: send job command

* chore: open api
This commit is contained in:
Jason Rasmussen
2023-06-16 15:36:07 -04:00
committed by GitHub
parent f04e47803c
commit fde410e2ac
12 changed files with 49 additions and 44 deletions
@@ -14,7 +14,7 @@ import { MemoryLaneResponseDto } from '@app/domain/asset/response-dto/memory-lan
export class AssetController {
constructor(private service: AssetService) {}
@Get('/map-marker')
@Get('map-marker')
getMapMarkers(@GetAuthUser() authUser: AuthUserDto, @Query() options: MapMarkerDto): Promise<MapMarkerResponseDto[]> {
return this.service.getMapMarkers(authUser, options);
}
@@ -28,7 +28,7 @@ import { UUIDParamDto } from './dto/uuid-param.dto';
@Authenticated()
@UseValidation()
export class AuthController {
constructor(private readonly service: AuthService) {}
constructor(private service: AuthService) {}
@PublicRoute()
@Post('login')
@@ -16,9 +16,8 @@ export class JobController {
return this.service.getAllJobsStatus();
}
@Put('/:jobId')
async sendJobCommand(@Param() { jobId }: JobIdDto, @Body() dto: JobCommandDto): Promise<JobStatusDto> {
await this.service.handleCommand(jobId, dto);
return this.service.getJobStatus(jobId);
@Put(':id')
sendJobCommand(@Param() { id }: JobIdDto, @Body() dto: JobCommandDto): Promise<JobStatusDto> {
return this.service.handleCommand(id, dto);
}
}