* Fix inactive patron search
* New patrons are active by default
* Ensure new cards are correctly linked to new patrons.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <js7389@princeton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
patron.isnew(true);
patron.id(-1);
patron.home_ou(this.auth.user().ws_ou());
+ patron.active('t');
patron.settings([]);
patron.waiver_entries([]);
patron.stat_cat_entries([]);
const card = this.idl.create('ac');
card.isnew(true);
card.usr(-1);
+ card.id(this.autoId--);
patron.card(card);
patron.cards([card]);
pSearch.search,
pager.limit,
sorter,
- null, // ?
+ this.search.inactive,
pSearch.orgId,
DEFAULT_FLESH,
pager.offset
const search: PatronSearchFieldSet = {};
Object.keys(this.search).forEach(field => {
+ if (field === 'inactive') { return; }
search[field] = this.mapSearchField(field);
- if (search[field]) {
- // one filter is not enough
- if (field !== 'inactive') { hasSearch = true; }
+ if (search[field] !== null) {
+ hasSearch = true;
} else {
delete search[field];
}
switch (field) {
case 'name': // name keywords
- case 'inactive':
delete chunk.group;
break;