Skip to content

Commit 73ba0ea

Browse files
author
Matus Kasak
committed
Use the failure i18n key when a delete fails
The error branch of the EPeople registry delete handler was reusing 'notification.deleted.success', so any non-self-delete failure showed a red toast reading "Successfully deleted EPerson" with an empty name. Switch to 'notification.deleted.failure' and pass restResponse, which the failure string interpolates as {{restResponse.errorMessage}}. This matches what dtq-dev already does (07957d8) — the hunk was missed when the change was translated to the 9.x component. Raised by Copilot review on PR #1447. Refs dataquest-dev/dspace-customers#855
1 parent 174f05a commit 73ba0ea

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/app/access-control/epeople-registry/epeople-registry.component.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,13 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
279279
} else if (this.isCurrentUser(ePerson) || this.deleteGuard.isSelfDeletionError(restResponse)) {
280280
this.deleteGuard.showSelfDeleteNotification();
281281
} else {
282-
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { id: ePerson.id, statusCode: restResponse.statusCode, errorMessage: restResponse.errorMessage }));
282+
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.deleted.failure', {
283+
name: this.dsoNameService.getName(ePerson),
284+
id: ePerson.id,
285+
statusCode: restResponse.statusCode,
286+
errorMessage: restResponse.errorMessage,
287+
restResponse,
288+
}));
283289
}
284290
});
285291
}

0 commit comments

Comments
 (0)