Skip to content

Commit

Permalink
fix: [admin/jobs] corrige un bug de la sidebar (#178)
Browse files Browse the repository at this point in the history
* lors de la création d'un job, les entreprises ne remontaient pas
  • Loading branch information
matthieuaudemard committed Nov 15, 2021
1 parent 1d3a00e commit aff8416
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class JobPostingFormComponent extends SidebarContentComponent implements
}

ngOnInit(): void {
this.companyService.getAll(this.pageable)
this.companyService.getAll({...Constants.ALL_VALUE_PAGEABLE, sortBy: 'name'})
.subscribe(data => {
this.companies = data.content;
});
Expand All @@ -57,8 +57,10 @@ export class JobPostingFormComponent extends SidebarContentComponent implements
if (this.formJob.invalid) {
return;
}

const job: JobPosting = {...this.formJob.value};
let job$: Observable<JobPosting>;

if (this.isUpdate) {
job.status = this.job.status;
job.id = this.sidebarInput.job.id;
Expand All @@ -67,6 +69,7 @@ export class JobPostingFormComponent extends SidebarContentComponent implements
job.status = StatusEnum.JOB_AVAILABLE;
job$ = this.jobService.createJob(job);
}

job$.subscribe(
jobUpdate => {
if (this.isUpdate) {
Expand Down

0 comments on commit aff8416

Please sign in to comment.