Commit cc49f5d6 by Harsh Shah

Create Job - check visibility only if button is enabled

parent 908b2246
......@@ -192,31 +192,33 @@ export class AdminPortalLayoutComponent implements OnInit, OnDestroy {
}
createJobClicked(): void {
this.showLoader = true;
this.subscriptions.push(
this.adminPortalLayoutService.createJob(this.selectedTeamID, this.companyUser)
.subscribe(
data => {
if (data.AllowCreateJob) {
if (data.AllowCreateJob === 'REACHED_CAP') {
this.modalService.show(this.reachedCapModal);
} else if (data.AllowCreateJob === 'TRIAL') {
this.modalService.show(this.trialNotAllowedModal);
} else {
this.router.navigate(['admin/iframe-page', data.redirectURL]);
if(!this.createJobDisabled) {
this.showLoader = true;
this.subscriptions.push(
this.adminPortalLayoutService.createJob(this.selectedTeamID, this.companyUser)
.subscribe(
data => {
if (data.AllowCreateJob) {
if (data.AllowCreateJob === 'REACHED_CAP') {
this.modalService.show(this.reachedCapModal);
} else if (data.AllowCreateJob === 'TRIAL') {
this.modalService.show(this.trialNotAllowedModal);
} else {
this.router.navigate(['admin/iframe-page', data.redirectURL]);
}
this.isStandardUser = data.StandardUser;
this.redirectURL = data.redirectURL;
this.showLoader = false;
}
this.isStandardUser = data.StandardUser;
this.redirectURL = data.redirectURL;
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
},
error => {
this.showLoader = false;
this.utilsService.handleError(error);
}
)
);
)
);
}
}
ngOnDestroy(): void {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment