diff --git a/src/Client/src/app/pages/company/editor/editor.component.html b/src/Client/src/app/pages/company/editor/editor.component.html index db1c67f..53a4e56 100644 --- a/src/Client/src/app/pages/company/editor/editor.component.html +++ b/src/Client/src/app/pages/company/editor/editor.component.html @@ -156,7 +156,11 @@
- + @if(isNewCompany){ + + }@else{ + + }
diff --git a/src/Client/src/app/pages/jobs/editor/jobeditor.component.ts b/src/Client/src/app/pages/jobs/editor/jobeditor.component.ts index 941e2b4..df01516 100644 --- a/src/Client/src/app/pages/jobs/editor/jobeditor.component.ts +++ b/src/Client/src/app/pages/jobs/editor/jobeditor.component.ts @@ -20,9 +20,9 @@ export class JobEditorComponent { currentStep: number = 0; public Listing: JobListing = new JobListing(); + public isNewListing: boolean = true; public mode: string = ""; - public modeID: number = 0; constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { this.title.setTitle("Jobs - Editor | BoredCareers"); @@ -39,10 +39,11 @@ export class JobEditorComponent { this.router.navigate([""]); }else if (CompanyID !== null ){ this.mode = "new"; - this.modeID = CompanyID; + this.Listing.companyID = CompanyID; }else if(JobID !== null){ this.mode = "edit"; - this.modeID = JobID; + this.Listing.id = JobID; + this.isNewListing = false; }else if (CompanyID === null && JobID === null){ this.router.navigate([""]); } @@ -90,14 +91,9 @@ export class JobEditorComponent { } SubmitForm(jobListing: JobListing){ - if (this.mode === "new"){ - jobListing.companyID = this.modeID; - } else if (this.mode === "edit"){ - jobListing.id = this.modeID; - } this.http.post("api/joblisting", jobListing).subscribe({ next: data => { - this.router.navigate([""]); + this.router.navigate(["/company"]); }, error: err => { this.ErrorMsg = err.error;