this.setCurrentPerms();
if (this.route.snapshot.paramMap.get('tab') === 'patron') {
- this.onTabChange({nextId: "'patron'"})
- } else { // if null or copy
- this.onTabChange({nextId: "'copy'"})
+ this.onTabChange({nextId: '\'patron\''});
+ } else { // if null or 'copy'
+ this.onTabChange({nextId: '\'copy\''});
}
});
}
onTabChange(event: any) {
this.currentTab = event.nextId;
- if (this.currentTab === "'patron'") {
+ if (this.currentTab === '\'patron\'') {
this.routeToTab('patron');
this.orgOnChange(this.selectedPatronOrg, 'patron');
} else {
.then(str => this.toast.danger(str));
return;
}
-
+
// check to see if copy stat cat is in use
if (idlString === 'asc') {
- this.checkThenDelete(idlThings, idlString)
+ this.checkThenDelete(idlThings, idlString);
} else {
this.doDelete(idlThings, idlString);
}
}
checkThenDelete = (idlThings, idlString) => {
- let promises: any[] = [];
+ const promises: any[] = [];
idlThings.forEach(idlThing => { // check one at a time to see if it's used
const id = idlThing.id();
- let promise : any = new Promise((resolve, reject) => {
+ const promise: any = new Promise((resolve, reject) => {
this.pcrud.search('ascecm', {stat_cat: id}, {limit: 1})
.toPromise().then(
rec => {
resolve(true);
}
});
- })
+ });
promises.push(promise);
});
- let result = Promise.all(promises);
+ const result = Promise.all(promises);
result.then(responses => {
if (!responses.includes(false)) { // only delete if none in use
- this.doDelete(idlThings, idlString);
+ this.doDelete(idlThings, idlString);
}
});
}
newIdlObject.owner(this.selectedPatronOrg);
} else {
currentGrid = this.copyGrid;
-
+
currentDialog = this.copyDialog;
newIdlObject = this.idl.clone(this.newAsc);
newIdlObject.owner(this.selectedCopyOrg);