Edit company/jobs to load data

This commit is contained in:
2025-07-30 21:02:49 -07:00
parent 0971bedc42
commit dda7077e74
@@ -16,27 +16,26 @@ import { Authentication } from 'app/services/Authentication';
export class CompanyJobsComponent { export class CompanyJobsComponent {
public MyJobListings: JobListing[] = []; public MyJobListings: JobListing[] = [];
public JobListingPage: JobListing[] = [];
public ErrorMsg: string = ""; public ErrorMsg: string = "";
public Page: number = 1;
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) { constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
this.title.setTitle("Company - Jobs | BoredCareers"); this.title.setTitle("Company - Jobs | BoredCareers");
if (this.Page == 1){ this.route.queryParams.subscribe(params => {
const companyID = params['CompanyID'];
} if (companyID){
http.get<JobListing[]>("api/joblisting/company?CompanyID=" + companyID).subscribe({
http.get<JobListing[]>("api/joblisting?PageQuantity=" + 10 + "&Page=" + 1).subscribe({
next: data => { next: data => {
this.JobListingPage = data; this.MyJobListings = data;
}, },
error: err => { error: err => {
this.ErrorMsg = err.error; this.ErrorMsg = err.error;
} }
}); });
}else{
router.navigate(["/company"]);
}
});
}; };
RemoveJobListing( JobListingID: number ){ RemoveJobListing( JobListingID: number ){