Bug 10190: prevent duplicate ruleset load
- prevent the initial API call and subsequent exhaustive applied ruleset list generation logic from running twice Signed-off-by: Michaela <michaela.sieber@kit.edu> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
3bb6f2e69c
commit
564f15ca59
|
|
@ -336,12 +336,6 @@ export default {
|
|||
displayAllApplicableRules: 1,
|
||||
};
|
||||
},
|
||||
beforeRouteEnter(to, from, next) {
|
||||
next(async vm => {
|
||||
vm.filtersInitialized = true;
|
||||
await vm.filterRuleSetsbySearchParam();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
async loadRuleSets() {
|
||||
this.ruleSetInitialized = false;
|
||||
|
|
@ -429,11 +423,16 @@ export default {
|
|||
this.showModal = newVal.meta && newVal.meta.showModal;
|
||||
},
|
||||
},
|
||||
"$route.query.refresh": {
|
||||
async handler(newVal) {
|
||||
if (newVal) {
|
||||
"$route.query": {
|
||||
async handler() {
|
||||
if (
|
||||
this.$route.fullPath.includes("refresh") ||
|
||||
this.$route.path.endsWith("circulation_triggers")
|
||||
) {
|
||||
await this.$nextTick();
|
||||
await this.filterRuleSetsbySearchParam();
|
||||
}
|
||||
this.filtersInitialized = true;
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -400,6 +400,12 @@ export const useCircRulesStore = defineStore("circRules", () => {
|
|||
{},
|
||||
{ library_id: "*", effective: false }
|
||||
);
|
||||
if (this.currentLibraryId === "*") {
|
||||
this.allCurrentLibraryRawRuleSets =
|
||||
this.allDefaultLibraryRawRuleSets;
|
||||
return;
|
||||
}
|
||||
|
||||
this.allCurrentLibraryRawRuleSets = await client.circ_rules.getAll(
|
||||
{},
|
||||
{ library_id: this.currentLibraryId, effective: false }
|
||||
|
|
|
|||
Loading…
Reference in New Issue