diff --git a/src/database/entities/jobs.entity.ts b/src/database/entities/jobs.entity.ts index 9e72e39..2c76f42 100644 --- a/src/database/entities/jobs.entity.ts +++ b/src/database/entities/jobs.entity.ts @@ -132,4 +132,7 @@ export class JobsEntity { @UpdateDateColumn({ update: true }) updatedAt: Date; + + @Column({ nullable: true }) + content: string; } diff --git a/src/modules/jobs/jobs.controller.ts b/src/modules/jobs/jobs.controller.ts index 4e026c9..27f6ecb 100644 --- a/src/modules/jobs/jobs.controller.ts +++ b/src/modules/jobs/jobs.controller.ts @@ -132,8 +132,9 @@ export class JobsController { async archivedJob( @Param('id', new GetEntity(JobsEntity)) job: JobsEntity, + @Body('content') content: string, ) { - return this.deleteJobService.execute(job); + return this.deleteJobService.execute(job, content); } @Post('/search/:keyword') diff --git a/src/modules/jobs/jobs.module.ts b/src/modules/jobs/jobs.module.ts index a3ca8d2..bc041ac 100644 --- a/src/modules/jobs/jobs.module.ts +++ b/src/modules/jobs/jobs.module.ts @@ -1,7 +1,8 @@ import { Module } from '@nestjs/common'; -import { AuthGuard, PassportModule } from '@nestjs/passport'; +import { PassportModule } from '@nestjs/passport'; import { TypeOrmModule } from '@nestjs/typeorm'; -import passport, { Passport } from 'passport'; +import { CompanyModule } from '../company/company.module'; +import { CompanyRepository } from '../company/repository/company-repository'; import { MailModule } from '../mails/mail.module'; import { JobsController } from './jobs.controller'; import { JobRepository } from './repository/job.repository'; @@ -13,8 +14,6 @@ import { UpdateJobService, } from './services'; import { SearchJobsService } from './services/search-job.service'; -import { CompanyRepository } from '../company/repository/company-repository'; -import { CompanyModule } from '../company/company.module'; @Module({ imports: [ diff --git a/src/modules/jobs/services/delete-job.service.ts b/src/modules/jobs/services/delete-job.service.ts index 2aa8ef4..52dad5c 100644 --- a/src/modules/jobs/services/delete-job.service.ts +++ b/src/modules/jobs/services/delete-job.service.ts @@ -7,8 +7,9 @@ import { JobRepository } from '../repository/job.repository'; export class DeleteJobService { constructor(private jobRepository: JobRepository) {} - async execute(job: JobsEntity) { + async execute(job: JobsEntity, content: string) { job.status = StatusEnum.ARCHIVED; + job.content = content; return this.jobRepository.save(job); } }