From ed8ee45f825be58031ddadbaf85a470ce9f928fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A8re=20Pique?= Date: Tue, 24 Sep 2024 14:18:13 +0200 Subject: [PATCH] fix: lint frontend --- .../backend/src/services/DemandeSejour.js | 2 +- .../src/components/demandes-sejour/liste.vue | 5 ++-- .../src/pages/comptes/[[userId]].vue | 2 +- .../src/pages/sejours/[declarationId].vue | 1 - .../src/components/DS/Eigs.vue | 3 ++- .../src/components/demande-sejour/liste.vue | 6 +---- .../frontend-usagers/src/pages/eig/liste.vue | 26 +++++++++++-------- .../src/stores/demande-sejour.js | 2 +- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/packages/backend/src/services/DemandeSejour.js b/packages/backend/src/services/DemandeSejour.js index 1e583f013..a0890f1da 100644 --- a/packages/backend/src/services/DemandeSejour.js +++ b/packages/backend/src/services/DemandeSejour.js @@ -268,7 +268,7 @@ LEFT JOIN front.demande_sejour_message dsm ON dsm.declaration_id = ds.id AND dsm WHERE o.id IN ($1) `, - [organismeIds], + [organismeIds], ], getAdminStats: (departements, territoireCode) => [ ` diff --git a/packages/frontend-bo/src/components/demandes-sejour/liste.vue b/packages/frontend-bo/src/components/demandes-sejour/liste.vue index bc54c9297..0c0adff81 100644 --- a/packages/frontend-bo/src/components/demandes-sejour/liste.vue +++ b/packages/frontend-bo/src/components/demandes-sejour/liste.vue @@ -200,7 +200,6 @@ import "@vueform/multiselect/themes/default.css"; import { defineProps } from "vue"; import messageEtat from "@vao/shared/src/utils/messageUtils"; - definePageMeta({ middleware: ["is-connected", "check-role"], roles: ["DemandeSejour_Lecture", "DemandeSejour_Ecriture"], @@ -468,7 +467,9 @@ const headersMessagerie = [ ]; const headers = computed(() => - props.display === displayType.Organisme ? headersOrganisme : headersMessagerie, + props.display === displayType.Organisme + ? headersOrganisme + : headersMessagerie, ); const tabIndexSejour = computed(() => diff --git a/packages/frontend-bo/src/pages/comptes/[[userId]].vue b/packages/frontend-bo/src/pages/comptes/[[userId]].vue index f7f65001e..958207e26 100644 --- a/packages/frontend-bo/src/pages/comptes/[[userId]].vue +++ b/packages/frontend-bo/src/pages/comptes/[[userId]].vue @@ -47,4 +47,4 @@ onMounted(async () => { } log.i("Mounted - DONE"); }); - \ No newline at end of file + diff --git a/packages/frontend-bo/src/pages/sejours/[declarationId].vue b/packages/frontend-bo/src/pages/sejours/[declarationId].vue index a18929e88..5cb6543e5 100644 --- a/packages/frontend-bo/src/pages/sejours/[declarationId].vue +++ b/packages/frontend-bo/src/pages/sejours/[declarationId].vue @@ -257,7 +257,6 @@ onMounted(async () => { } catch (e) { navigateTo("/sejours"); } - }); const isSendingMessage = ref(false); diff --git a/packages/frontend-usagers/src/components/DS/Eigs.vue b/packages/frontend-usagers/src/components/DS/Eigs.vue index 81795a164..9c48cc884 100644 --- a/packages/frontend-usagers/src/components/DS/Eigs.vue +++ b/packages/frontend-usagers/src/components/DS/Eigs.vue @@ -109,8 +109,9 @@ const deleteEig = async () => { try { await eigStore.delete(eigToDelete.value); await props.fetchEig(); - } catch (e) { + } catch (error) { toaster.error("Une erreur est survenue de la suppression de l'EIG"); + throw error; } finally { closeEigModal(); } diff --git a/packages/frontend-usagers/src/components/demande-sejour/liste.vue b/packages/frontend-usagers/src/components/demande-sejour/liste.vue index cd8ecf05e..dcc82eaa5 100644 --- a/packages/frontend-usagers/src/components/demande-sejour/liste.vue +++ b/packages/frontend-usagers/src/components/demande-sejour/liste.vue @@ -229,7 +229,6 @@ import { useDemandeSejourStore } from "~/stores/demande-sejour"; import { DeclarationSejour } from "#imports"; import { defineProps } from "vue"; - const NuxtLink = resolveComponent("NuxtLink"); const DsfrBadge = resolveComponent("DsfrBadge"); const DsfrButtonGroup = resolveComponent("DsfrButtonGroup"); @@ -241,7 +240,6 @@ const props = defineProps({ display: { type: String, required: true }, }); - definePageMeta({ middleware: ["is-connected", "check-organisme-is-complet"], }); @@ -640,7 +638,6 @@ const headersOrganisme = [ }, ]; - const headersMessagerie = [ { column: "idFonctionnelle", @@ -839,6 +836,5 @@ onMounted(async () => { demandeSejourStore.fetchDemandes({ sortBy: defaultSort.value, }); -}) - +}); diff --git a/packages/frontend-usagers/src/pages/eig/liste.vue b/packages/frontend-usagers/src/pages/eig/liste.vue index 1a81e8009..ca036493c 100644 --- a/packages/frontend-usagers/src/pages/eig/liste.vue +++ b/packages/frontend-usagers/src/pages/eig/liste.vue @@ -129,16 +129,6 @@ const searchState = reactive({ type: null, }); -try { - await eigStore.get({ - limit: defaultLimit, - offset: defaultOffset, - search: searchState, - }); -} catch (error) { - toaster.error("Une erreur est survenue lors de la récupération des demandes"); -} - const paginateResults = async (sortValue, limitValue, currentPageValue) => { try { await eigStore.get({ @@ -152,6 +142,7 @@ const paginateResults = async (sortValue, limitValue, currentPageValue) => { toaster.error( "Une erreur est survenue lors de la récupération de la demande", ); + throw error; } }; @@ -168,6 +159,7 @@ const fetchDemandesDebounce = debounce(async (search) => { toaster.error( "Une erreur est survenue lors de la récupération de la demande", ); + throw error; } }); @@ -315,10 +307,22 @@ const deleteEig = async () => { try { await eigStore.delete(eigToDelete.value); await eigStore.get(); - } catch (e) { + } catch (error) { toaster.error("Une erreur est survenue de la suppression de l'EIG"); + throw error; } finally { closeEigModal(); } }; + +try { + await eigStore.get({ + limit: defaultLimit, + offset: defaultOffset, + search: searchState, + }); +} catch (error) { + toaster.error("Une erreur est survenue lors de la récupération des demandes"); + throw error; +} diff --git a/packages/frontend-usagers/src/stores/demande-sejour.js b/packages/frontend-usagers/src/stores/demande-sejour.js index 9d2e7e6f8..c464a9e34 100644 --- a/packages/frontend-usagers/src/stores/demande-sejour.js +++ b/packages/frontend-usagers/src/stores/demande-sejour.js @@ -29,7 +29,7 @@ export const useDemandeSejourStore = defineStore("demandeSejour", { credentials: "include", params: { sortBy, - } + }, }); if (demandes) { log.i("fetchDemandes - DONE");