fix delete callback

This commit is contained in:
Efstratios Giannopoulos 2024-04-05 18:03:26 +03:00
parent 7ebe22a45f
commit 45e3426969
14 changed files with 36 additions and 28 deletions

View File

@ -267,7 +267,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor<DescriptionTe
if (result) { if (result) {
this.descriptionTemplateService.delete(value.id).pipe(takeUntil(this._destroyed)) this.descriptionTemplateService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -163,7 +163,7 @@ export class DescriptionTemplateTypeEditorComponent extends BaseEditor<Descripti
if (result) { if (result) {
this.descriptionTemplateTypeService.delete(value.id).pipe(takeUntil(this._destroyed)) this.descriptionTemplateTypeService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -261,7 +261,7 @@ export class DmpBlueprintEditorComponent extends BaseEditor<DmpBlueprintEditorMo
if (result) { if (result) {
this.dmpBlueprintService.delete(value.id).pipe(takeUntil(this._destroyed)) this.dmpBlueprintService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.cancel(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -183,7 +183,7 @@ export class LanguageEditorComponent extends BaseEditor<LanguageEditorModel, Lan
if (result) { if (result) {
this.languageHttpService.delete(value.id).pipe(takeUntil(this._destroyed)) this.languageHttpService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -217,7 +217,7 @@ export class NotificationTemplateEditorComponent extends BaseEditor<Notification
if (result) { if (result) {
this.notificationTemplateService.delete(value.id).pipe(takeUntil(this._destroyed)) this.notificationTemplateService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -169,7 +169,7 @@ export class PrefillingSourceEditorComponent extends BaseEditor<PrefillingSource
if (result) { if (result) {
this.prefillingSourceService.delete(value.id).pipe(takeUntil(this._destroyed)) this.prefillingSourceService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -182,7 +182,7 @@ export class ReferenceTypeEditorComponent extends BaseEditor<ReferenceTypeEditor
if (result) { if (result) {
this.referenceTypeService.delete(value.id).pipe(takeUntil(this._destroyed)) this.referenceTypeService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -176,7 +176,7 @@ export class ReferenceEditorComponent extends BaseEditor<ReferenceEditorModel, R
if (result) { if (result) {
this.referenceService.delete(value.id).pipe(takeUntil(this._destroyed)) this.referenceService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -179,7 +179,7 @@ export class TenantEditorComponent extends BaseEditor<TenantEditorModel, Tenant>
if (result) { if (result) {
this.tenantService.delete(value.id).pipe(takeUntil(this._destroyed)) this.tenantService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -663,7 +663,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
if (result) { if (result) {
this.descriptionService.delete(value.id).pipe(takeUntil(this._destroyed)) this.descriptionService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -290,7 +290,7 @@ export class DmpEditorComponent extends BaseEditor<DmpEditorModel, Dmp> implemen
if (result) { if (result) {
this.dmpService.delete(value.id).pipe(takeUntil(this._destroyed)) this.dmpService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -108,7 +108,7 @@ export class InAppNotificationEditorComponent extends BaseComponent implements O
if (result) { if (result) {
this.inappNotificationService.delete(value.id).pipe(takeUntil(this._destroyed)) this.inappNotificationService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.cancel(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -168,7 +168,7 @@ export class SupportiveMaterialEditorComponent extends BaseEditor<SupportiveMate
if (result) { if (result) {
this.supportiveMaterialService.delete(value.id).pipe(takeUntil(this._destroyed)) this.supportiveMaterialService.delete(value.id).pipe(takeUntil(this._destroyed))
.subscribe( .subscribe(
complete => this.onCallbackSuccess(), complete => this.onCallbackDeleteSuccess(),
error => this.onCallbackError(error) error => this.onCallbackError(error)
); );
} }

View File

@ -117,6 +117,14 @@ export abstract class BaseEditor<EditorModelType extends BaseEditorModel, Entity
this.refreshOnNavigateToData(data ? data.id : null); this.refreshOnNavigateToData(data ? data.id : null);
} }
onCallbackDeleteSuccess(data?: any): void {
console.log("Success Delete:", data);
this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-DELETE'), SnackBarNotificationLevel.Success);
this.cancel();
}
onCallbackError(errorResponse: HttpErrorResponse) { onCallbackError(errorResponse: HttpErrorResponse) {
console.log("Error:", errorResponse); console.log("Error:", errorResponse);