From 9e942ea0171ca1c5937af1ced9e439da65ea46b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Chambon?= Date: Thu, 12 Oct 2023 11:25:19 +0200 Subject: [PATCH] stateful composable useStrategy --- composables/useStrategyAPI.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/composables/useStrategyAPI.js b/composables/useStrategyAPI.js index 4ab80bb3..5c0b1b35 100644 --- a/composables/useStrategyAPI.js +++ b/composables/useStrategyAPI.js @@ -2,19 +2,9 @@ import { ref } from "vue"; import { useDisplay } from "vuetify"; import { replaceAndEscape } from "../services/Common"; - -export default function () { -// import fonctions -const { fetchCodeLangues, createLabels, getLabelFromCode } = useReferentielsAPI(); -const { suggestionTheses, getFacetsTheses, getThese, queryThesesAPI, getItemsTriTheses, disableOrFiltersTheses, getItemsTriMapTheses } = useThesesAPI(); -const { suggestionPersonne, getFacetsPersonnes, getPersonne, queryPersonnesAPI, getItemsTriPersonnes, disableOrFiltersPersonnes, getItemsTriMapPersonnes } = usePersonnesAPI(); - - /** * Initialisation */ -const router = useRouter(); - const domaine = ref("theses"); const currentPageNumber = ref(); const currentShowingNumber = ref(); @@ -26,6 +16,15 @@ const checkedFilters = ref([]); const currentWorkingFacetName = ref(""); const labelMap = ref(new Map()); +export default function () { +// import fonctions +const { fetchCodeLangues, createLabels, getLabelFromCode } = useReferentielsAPI(); +const { suggestionTheses, getFacetsTheses, getThese, queryThesesAPI, getItemsTriTheses, disableOrFiltersTheses, getItemsTriMapTheses } = useThesesAPI(); +const { suggestionPersonne, getFacetsPersonnes, getPersonne, queryPersonnesAPI, getItemsTriPersonnes, disableOrFiltersPersonnes, getItemsTriMapPersonnes } = usePersonnesAPI(); + + +const router = useRouter(); + fetchCodeLangues(); /**