Fix issue where the creation of resource policies failed even if successfully

This commit is contained in:
Giuseppe Digilio
2020-11-10 09:53:30 +01:00
parent 926cce8286
commit db7514fd25

View File

@@ -101,7 +101,9 @@ export class ResourcePolicyCreateComponent implements OnInit {
first((response: RemoteData<ResourcePolicy>) => !response.isResponsePending)
).subscribe((responseRD: RemoteData<ResourcePolicy>) => {
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 {