Skip to content

Commit

Permalink
search: fix second filter selection
Browse files Browse the repository at this point in the history
* Fixes second filter selection, which did not launch the search. This was caused by the search parameters subject which sends the original object instead of a copied one.
* Closes rero/rero-ils#1684.

Co-Authored-by: Sébastien Délèze <sebastien.deleze@rero.ch>
  • Loading branch information
Sébastien Délèze committed Mar 12, 2021
1 parent 40d5022 commit 9d57bb9
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -17,6 +17,7 @@
import { Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges } from '@angular/core';
import { FormlyFieldConfig } from '@ngx-formly/core';
import { TranslateService } from '@ngx-translate/core';
import { cloneDeep } from 'lodash-es';
import { NgxSpinnerService } from 'ngx-spinner';
import { BehaviorSubject, Observable, of, Subscription } from 'rxjs';
import { distinctUntilChanged, map, switchMap } from 'rxjs/operators';
Expand Down Expand Up @@ -317,7 +318,9 @@ export class RecordSearchComponent implements OnInit, OnChanges, OnDestroy {
if (resetPage) {
this.page = 1;
}
this._searchParameters.next(this._serializeSearchParameters());
// Deep copy is sent, to avoid the reference (source object) to be
// accidentally changed.
this._searchParameters.next(cloneDeep(this._serializeSearchParameters()));
}

/**
Expand Down

0 comments on commit 9d57bb9

Please sign in to comment.