[Send] Updated delete function for add/edit component (#277)
* [Send] Updated delete function for add/edit component * Saved final return statement
This commit is contained in:
parent
5f5580cff9
commit
8a3b551c6e
|
@ -219,16 +219,16 @@ export class AddEditComponent implements OnInit {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete(): Promise<void> {
|
async delete(): Promise<boolean> {
|
||||||
if (this.deletePromise != null) {
|
if (this.deletePromise != null) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
const confirmed = await this.platformUtilsService.showDialog(
|
const confirmed = await this.platformUtilsService.showDialog(
|
||||||
this.i18nService.t('deleteSendConfirmation'),
|
this.i18nService.t('deleteSendConfirmation'),
|
||||||
this.i18nService.t('deleteSend'),
|
this.i18nService.t('deleteSend'),
|
||||||
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
this.i18nService.t('yes'), this.i18nService.t('no'), 'warning');
|
||||||
if (!confirmed) {
|
if (!confirmed) {
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -237,7 +237,10 @@ export class AddEditComponent implements OnInit {
|
||||||
this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedSend'));
|
this.platformUtilsService.showToast('success', null, this.i18nService.t('deletedSend'));
|
||||||
await this.load();
|
await this.load();
|
||||||
this.onDeletedSend.emit(this.send);
|
this.onDeletedSend.emit(this.send);
|
||||||
|
return true;
|
||||||
} catch { }
|
} catch { }
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
typeChanged() {
|
typeChanged() {
|
||||||
|
|
Loading…
Reference in New Issue