From db7514fd2561f906e1b6989860bb99e81435b8f2 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Tue, 10 Nov 2020 09:53:30 +0100 Subject: [PATCH] Fix issue where the creation of resource policies failed even if successfully --- .../create/resource-policy-create.component.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/shared/resource-policies/create/resource-policy-create.component.ts b/src/app/shared/resource-policies/create/resource-policy-create.component.ts index 017e67841c..2873ba71e5 100644 --- a/src/app/shared/resource-policies/create/resource-policy-create.component.ts +++ b/src/app/shared/resource-policies/create/resource-policy-create.component.ts @@ -101,7 +101,9 @@ export class ResourcePolicyCreateComponent implements OnInit { first((response: RemoteData) => !response.isResponsePending) ).subscribe((responseRD: RemoteData) => { this.processing$.next(false); - if (responseRD.hasSucceeded) { + // NOTE Currently due to a bug a successful 201 response has failed + // TODO review it when https://github.com/DSpace/dspace-angular/issues/739 is fixed + if (responseRD.hasSucceeded || responseRD.statusCode === 201) { this.notificationsService.success(null, this.translate.get('resource-policies.create.page.success.content')); this.redirectToAuthorizationsPage(); } else {