LP#1942220: eg-item-location-select: fix use of contextOrgId
authorGalen Charlton <gmc@equinoxOLI.org>
Wed, 8 Dec 2021 15:42:20 +0000 (10:42 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Mon, 29 Aug 2022 22:43:58 +0000 (22:43 +0000)
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/share/item-location-select/item-location-select.component.ts

index 8d9873c..801501c 100644 (file)
@@ -267,7 +267,7 @@ export class ItemLocationSelectComponent
     }
 
     setFilterOrgs(): Promise<number[]> {
-        const org = this.contextOrgId || this.auth.user().ws_ou();
+        const org = this._contextOrgId || this.auth.user().ws_ou();
         const contextOrgIds = this.org.ancestors(org, true);
         this.filterOrgsApplied = true;
 
@@ -276,7 +276,9 @@ export class ItemLocationSelectComponent
         }
 
         const orgsFromCache = this.loc.filterOrgsCache[this.permFilter];
-        if (orgsFromCache) {
+        if (orgsFromCache && !this._contextOrgId) {
+            // if we're using contextOrgId, it may well change, so
+            // don't use the cache
             return Promise.resolve(this.filterOrgs = orgsFromCache);
         }