Skip to content

Commit 221c323

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 872f574 commit 221c323

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
@@ -282,7 +282,13 @@ export class EPeopleRegistryComponent implements OnInit, OnDestroy {
282282
} else if (this.isCurrentUser(ePerson) || this.deleteGuard.isSelfDeletionError(restResponse)) {
283283
this.deleteGuard.showSelfDeleteNotification();
284284
} else {
285-
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.deleted.success', { id: ePerson.id, statusCode: restResponse.statusCode, errorMessage: restResponse.errorMessage }));
285+
this.notificationsService.error(this.translateService.get(this.labelPrefix + 'notification.deleted.failure', {
286+
name: this.dsoNameService.getName(ePerson),
287+
id: ePerson.id,
288+
statusCode: restResponse.statusCode,
289+
errorMessage: restResponse.errorMessage,
290+
restResponse,
291+
}));
286292
}
287293
});
288294
}

0 commit comments

Comments
 (0)