diff --git a/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts b/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts index 3c933dc607..dce33ea122 100644 --- a/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts +++ b/src/app/shared/resource-policies/edit/resource-policy-edit.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { BehaviorSubject, Observable } from 'rxjs'; -import { first, map, take } from 'rxjs/operators'; +import { map, take } from 'rxjs/operators'; import { TranslateService } from '@ngx-translate/core'; import { ResourcePolicyService } from '../../../core/resource-policy/resource-policy.service'; @@ -12,6 +12,7 @@ import { ResourcePolicy } from '../../../core/resource-policy/models/resource-po import { ResourcePolicyEvent } from '../form/resource-policy-form.component'; import { RESOURCE_POLICY } from '../../../core/resource-policy/models/resource-policy.resource-type'; import { ITEM_EDIT_AUTHORIZATIONS_PATH } from '../../../+item-page/edit-item-page/edit-item-page.routing-paths'; +import { getSucceededRemoteWithNotEmptyData } from '../../../core/shared/operators'; @Component({ selector: 'ds-resource-policy-edit', @@ -88,7 +89,8 @@ export class ResourcePolicyEditComponent implements OnInit { _links: this.resourcePolicy._links }); this.resourcePolicyService.update(updatedObject).pipe( - first((response: RemoteData) => !response.isResponsePending) + getSucceededRemoteWithNotEmptyData(), + take(1) ).subscribe((responseRD: RemoteData) => { this.processing$.next(false); if (responseRD.hasSucceeded) {