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:
Chloe Zermatten 2026-02-09 15:02:57 +00:00 committed by Pedro Amorim
parent 3bb6f2e69c
commit 564f15ca59
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
2 changed files with 14 additions and 9 deletions

View File

@ -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,
},

View File

@ -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 }