feat: tag cleanup job (#12654)

This commit is contained in:
Jason Rasmussen 2024-09-16 16:49:12 -04:00 committed by GitHub
parent 4a1ff6abce
commit b74b20824a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 476 additions and 10 deletions

View file

@ -1,6 +1,6 @@
import { Body, Controller, Get, Param, Put } from '@nestjs/common';
import { Body, Controller, Get, Param, Post, Put } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { AllJobStatusResponseDto, JobCommandDto, JobIdParamDto, JobStatusDto } from 'src/dtos/job.dto';
import { AllJobStatusResponseDto, JobCommandDto, JobCreateDto, JobIdParamDto, JobStatusDto } from 'src/dtos/job.dto';
import { Authenticated } from 'src/middleware/auth.guard';
import { JobService } from 'src/services/job.service';
@ -15,6 +15,12 @@ export class JobController {
return this.service.getAllJobsStatus();
}
@Post()
@Authenticated({ admin: true })
createJob(@Body() dto: JobCreateDto): Promise<void> {
return this.service.create(dto);
}
@Put(':id')
@Authenticated({ admin: true })
sendJobCommand(@Param() { id }: JobIdParamDto, @Body() dto: JobCommandDto): Promise<JobStatusDto> {