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
No related branches found
No related tags found
No related merge requests found
......@@ -108,7 +108,7 @@ export class ItemRelationshipsComponent extends AbstractItemUpdateComponent {
// TODO: Fix lists refreshing correctly
this.objectCache.remove(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.initializeUpdates();
this.notificationsService.success(this.getNotificationTitle('saved'), this.getNotificationContent('saved'));
......
......@@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
import { createSelector, MemoizedSelector, select, Store } from '@ngrx/store';
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 { hasValue, isNotEmpty } from '../../shared/empty.util';
......@@ -64,8 +64,7 @@ const uuidsFromHrefSubstringSelector =
const getUuidsFromHrefSubstring = (state: IndexState, href: string): string[] => {
let result = [];
if (isNotEmpty(state)) {
result = Object.values(state)
.filter((value: string) => value.startsWith(href));
result = Object.keys(state).filter((key) => key.startsWith(href)).map((key) => state[key]);
}
return result;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment