diff --git a/src/Client/src/app/pages/main/company/jobs/jobs.component.ts b/src/Client/src/app/pages/main/company/jobs/jobs.component.ts index d6a3483..d81f192 100644 --- a/src/Client/src/app/pages/main/company/jobs/jobs.component.ts +++ b/src/Client/src/app/pages/main/company/jobs/jobs.component.ts @@ -16,27 +16,26 @@ import { Authentication } from 'app/services/Authentication'; export class CompanyJobsComponent { public MyJobListings: JobListing[] = []; - public JobListingPage: JobListing[] = []; public ErrorMsg: string = ""; - public Page: number = 1; - constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { this.title.setTitle("Company - Jobs | BoredCareers"); - if (this.Page == 1){ - - } - - http.get("api/joblisting?PageQuantity=" + 10 + "&Page=" + 1).subscribe({ - next: data => { - this.JobListingPage = data; - }, - error: err => { - this.ErrorMsg = err.error; - } - }); - + this.route.queryParams.subscribe(params => { + const companyID = params['CompanyID']; + if (companyID){ + http.get("api/joblisting/company?CompanyID=" + companyID).subscribe({ + next: data => { + this.MyJobListings = data; + }, + error: err => { + this.ErrorMsg = err.error; + } + }); + }else{ + router.navigate(["/company"]); + } + }); }; RemoveJobListing( JobListingID: number ){