mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-08 10:34:15 +00:00
fix issue where facets would be empty if you went straight to a search url in prod mode
This commit is contained in:
@@ -264,13 +264,21 @@ export class SearchService implements OnDestroy {
|
|||||||
return this.rdb.buildFromHref(href$).pipe(
|
return this.rdb.buildFromHref(href$).pipe(
|
||||||
map((rd: RemoteData<FacetConfigResponse>) => {
|
map((rd: RemoteData<FacetConfigResponse>) => {
|
||||||
if (rd.hasSucceeded) {
|
if (rd.hasSucceeded) {
|
||||||
|
let filters: SearchFilterConfig[];
|
||||||
|
if (isNotEmpty(rd.payload.filters)) {
|
||||||
|
filters = rd.payload.filters
|
||||||
|
.map((filter: any) => Object.assign(new SearchFilterConfig(), filter));
|
||||||
|
} else {
|
||||||
|
filters = [];
|
||||||
|
}
|
||||||
|
|
||||||
return new RemoteData(
|
return new RemoteData(
|
||||||
rd.timeCompleted,
|
rd.timeCompleted,
|
||||||
rd.msToLive,
|
rd.msToLive,
|
||||||
rd.lastUpdated,
|
rd.lastUpdated,
|
||||||
rd.state,
|
rd.state,
|
||||||
rd.errorMessage,
|
rd.errorMessage,
|
||||||
rd.payload.filters,
|
filters,
|
||||||
rd.statusCode,
|
rd.statusCode,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user