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 {
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<JobListing[]>("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<JobListing[]>("api/joblisting/company?CompanyID=" + companyID).subscribe({
next: data => {
this.MyJobListings = data;
},
error: err => {
this.ErrorMsg = err.error;
}
});
}else{
router.navigate(["/company"]);
}
});
};
RemoveJobListing( JobListingID: number ){