working #8
@@ -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 ){
|
||||
|
||||
Reference in New Issue
Block a user