working #29
@@ -28,12 +28,13 @@ export class CompanyComponent {
|
||||
|
||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
||||
this.title.setTitle("Companies | BoredCareers");
|
||||
|
||||
if (!auth.isLoggedIn){
|
||||
router.navigate(["/"]);
|
||||
}
|
||||
};
|
||||
|
||||
http.get<Employee[]>("api/employee/").subscribe({
|
||||
ngOnInit(){
|
||||
this.http.get<Employee[]>("api/employee/").subscribe({
|
||||
next: data => {
|
||||
this.Employers = data;
|
||||
if (data[0] != null){
|
||||
@@ -46,7 +47,7 @@ export class CompanyComponent {
|
||||
this.ErrorMsg = err.error;
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
changeSelectedCompany(companyID: number){
|
||||
this.http.get<Company>("api/company?CompanyID=" + companyID).subscribe({
|
||||
|
||||
@@ -24,14 +24,15 @@ export class CompanyEditorComponent {
|
||||
|
||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
||||
this.title.setTitle("Company - Editor | BoredCareers");
|
||||
|
||||
if (!auth.isLoggedIn){
|
||||
router.navigate(["/"]);
|
||||
}
|
||||
};
|
||||
|
||||
ngOnInit(){
|
||||
// Query param CompanyID -> Edit
|
||||
// Query param null -> New
|
||||
};
|
||||
}
|
||||
|
||||
ngAfterViewInit(){
|
||||
this.formSteps.changes.subscribe(() => {
|
||||
|
||||
@@ -26,11 +26,12 @@ export class JobEditorComponent {
|
||||
|
||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
||||
this.title.setTitle("Jobs - Editor | BoredCareers");
|
||||
|
||||
if (!auth.isLoggedIn){
|
||||
router.navigate(["/"]);
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit(){
|
||||
this.route.queryParams.subscribe(params => {
|
||||
const CompanyID = params['CompanyID'] ? +params['CompanyID'] : null;
|
||||
const JobID = params['JobID'] ? +params['JobID'] : null;
|
||||
|
||||
@@ -23,12 +23,10 @@ export class JobsComponent {
|
||||
|
||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
||||
this.title.setTitle("Jobs | BoredCareers");
|
||||
};
|
||||
|
||||
if (this.Page == 1){
|
||||
|
||||
}
|
||||
|
||||
http.get<JobListing[]>("api/joblisting?PageQuantity=" + 10 + "&Page=" + 1).subscribe({
|
||||
ngOnInit(){
|
||||
this.http.get<JobListing[]>("api/joblisting?PageQuantity=" + 10 + "&Page=" + 1).subscribe({
|
||||
next: data => {
|
||||
this.JobListingPage = data;
|
||||
},
|
||||
@@ -36,7 +34,6 @@ export class JobsComponent {
|
||||
this.ErrorMsg = err.error;
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,7 +22,9 @@ export class JobViewerComponent {
|
||||
|
||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
||||
this.title.setTitle("Jobs - Viewer | BoredCareers");
|
||||
};
|
||||
|
||||
ngOnInit(){
|
||||
this.route.queryParams.subscribe(params => {
|
||||
const JobID = params['JobID'];
|
||||
if (JobID){
|
||||
@@ -43,13 +45,12 @@ export class JobViewerComponent {
|
||||
}
|
||||
})
|
||||
}else{
|
||||
router.navigate(["/"]);
|
||||
this.router.navigate(["/"]);
|
||||
}
|
||||
if (this.selectedJob != null){
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,6 +22,12 @@ export class ResumesEditorComponent {
|
||||
|
||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
||||
this.title.setTitle("Resume - Editor | BoredCareers");
|
||||
if (!this.auth.isLoggedIn){
|
||||
this.router.navigate(["/"]);
|
||||
}
|
||||
};
|
||||
|
||||
ngOnInit(){
|
||||
this.route.queryParams.subscribe(params => {
|
||||
const ResumeID = params['ResumeID'] ? +params['ResumeID'] : null;
|
||||
if (ResumeID !== null){
|
||||
@@ -37,12 +43,6 @@ export class ResumesEditorComponent {
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
async ngOnInit(){
|
||||
if (!this.auth.isLoggedIn){
|
||||
this.router.navigate(["/"]);
|
||||
}
|
||||
}
|
||||
|
||||
// Pagnation //
|
||||
|
||||
@@ -20,11 +20,12 @@ export class ResumesComponent {
|
||||
|
||||
constructor( private http: HttpClient, private router: Router, private route: ActivatedRoute, private title: Title, public auth: Authentication ) {
|
||||
this.title.setTitle("Resumes | BoredCareers");
|
||||
|
||||
if (!auth.isLoggedIn){
|
||||
router.navigate(["/"]);
|
||||
}
|
||||
};
|
||||
|
||||
ngOnInit(){
|
||||
this.http.get<Resume[]>("api/resume").subscribe({
|
||||
next: data => {
|
||||
this.myResumes = data;
|
||||
@@ -33,7 +34,7 @@ export class ResumesComponent {
|
||||
console.log("Error fetching resumes: " + err.error);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
changeSelectedResume(ResumeID: number){
|
||||
this.http.get<Resume>("api/resume?ResumeID=" + ResumeID).subscribe({
|
||||
|
||||
Reference in New Issue
Block a user