Skip to content

Commit

Permalink
Merge pull request #136 from wandersonDeve/main
Browse files Browse the repository at this point in the history
Main
  • Loading branch information
wandersonDeve authored Jul 31, 2023
2 parents f3c9fd0 + ecdc43c commit 14284d3
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 3 additions & 0 deletions src/database/entities/jobs.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,7 @@ export class JobsEntity {

@UpdateDateColumn({ update: true })
updatedAt: Date;

@Column({ nullable: true })
content: string;
}
3 changes: 2 additions & 1 deletion src/modules/jobs/jobs.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
7 changes: 3 additions & 4 deletions src/modules/jobs/jobs.module.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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: [
Expand Down
3 changes: 2 additions & 1 deletion src/modules/jobs/services/delete-job.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 14284d3

Please sign in to comment.