Skip to content
Snippets Groups Projects
Commit 01b60dbf authored by Kristof De Langhe's avatar Kristof De Langhe
Browse files

61142: RemoveByHrefSubstring fix

parent 9f27a89d
Branches
Tags
No related merge requests found
...@@ -108,7 +108,7 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent { ...@@ -108,7 +108,7 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent {
// TODO: Fix lists refreshing correctly // TODO: Fix lists refreshing correctly
this.objectCache.remove(this.item.self); this.objectCache.remove(this.item.self);
this.requestService.removeByHrefSubstring(this.item.self); this.requestService.removeByHrefSubstring(this.item.self);
this.itemService.findById(this.item.id).pipe(getSucceededRemoteData(), take(1)).subscribe((itemRD: RemoteData<Item>) => this.item = itemRD.payload); // this.itemService.findById(this.item.id).pipe(getSucceededRemoteData(), take(1)).subscribe((itemRD: RemoteData<Item>) => this.item = itemRD.payload);
this.initializeOriginalFields(); this.initializeOriginalFields();
this.initializeUpdates(); this.initializeUpdates();
this.notificationsService.success(this.getNotificationTitle('saved'), this.getNotificationContent('saved')); this.notificationsService.success(this.getNotificationTitle('saved'), this.getNotificationContent('saved'));
......
...@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core'; ...@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store'; import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
import { Observable, race as observableRace } from 'rxjs'; import { Observable, race as observableRace } from 'rxjs';
import { filter, mergeMap, take } from 'rxjs/operators'; import { filter, map, mergeMap, take, tap } from 'rxjs/operators';
import { AppState } from '../../app.reducer'; import { AppState } from '../../app.reducer';
import { hasValue, isNotEmpty } from '../../shared/empty.util'; import { hasValue, isNotEmpty } from '../../shared/empty.util';
...@@ -64,8 +64,7 @@ const uuidsFromHrefSubstringSelector = ...@@ -64,8 +64,7 @@ const uuidsFromHrefSubstringSelector =
const getUuidsFromHrefSubstring = (state: IndexState, href: string): string[] => { const getUuidsFromHrefSubstring = (state: IndexState, href: string): string[] => {
let result = []; let result = [];
if (isNotEmpty(state)) { if (isNotEmpty(state)) {
result = Object.values(state) result = Object.keys(state).filter((key) => key.startsWith(href)).map((key) => state[key]);
.filter((value: string) => value.startsWith(href));
} }
return result; return result;
}; };
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment