mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-16 22:43:03 +00:00
Fix issue where the edit of resource policies failed even if successfully
This commit is contained in:
@@ -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<ResourcePolicy>) => !response.isResponsePending)
|
||||
getSucceededRemoteWithNotEmptyData(),
|
||||
take(1)
|
||||
).subscribe((responseRD: RemoteData<ResourcePolicy>) => {
|
||||
this.processing$.next(false);
|
||||
if (responseRD.hasSucceeded) {
|
||||
|
Reference in New Issue
Block a user