Skip to content

Commit

Permalink
fix: count demandes sejour (#488)
Browse files Browse the repository at this point in the history
  • Loading branch information
iNeoO authored Sep 16, 2024
2 parents 6ada1db + 1fc8244 commit 49007c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/services/DemandeSejour.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,7 @@ SELECT
FROM
front.demande_sejour ds
JOIN front.organismes o ON o.id = ds.organisme_id
LEFT JOIN front.agrements a ON a.organisme_id = ds.organisme_id,
jsonb_array_elements(ds.hebergement -> 'hebergements') h
LEFT JOIN front.agrements a ON a.organisme_id = ds.organisme_id
WHERE
jsonb_path_query_array(hebergement, '$.hebergements[*].coordonnees.adresse.departement') ?| ($1)::text[]
OR a.region_obtention = '${territoireCode}'
Expand Down Expand Up @@ -1028,6 +1027,7 @@ module.exports.getHebergementsByDepartementCodes = async (

module.exports.getAdminStats = async (departements, territoireCode) => {
log.i("getAdminStats - IN");

const {
rows: [stats],
} = await pool.query(...query.getAdminStats(departements, territoireCode));
Expand Down
20 changes: 3 additions & 17 deletions packages/frontend-bo/src/components/demandes-sejour/liste.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
:values="[
{
title: 'Déclarations transmises à traiter',
value: sejourStore.stats?.transmis,
value: sejourStore.stats?.transmis || 0,
},
{
title: 'Déclarations en cours de traitement',
value: sejourStore.stats?.enCours,
value: sejourStore.stats?.enCours || 0,
},
{
title: 'Déclarations 8 jours à traiter',
value: sejourStore.stats?.transmis8J,
value: sejourStore.stats?.transmis8J || 0,
},
]"
/>
Expand Down Expand Up @@ -249,20 +249,6 @@ const searchParams = computed(() =>
}, {}),
);
sejourStore.currentDemande = null;
try {
await sejourStore.fetchDemandes({
limit: defaultLimit,
offset: defaultOffset,
search: searchParams.value,
});
} catch (error) {
toaster.error({
titleTag: "h2",
description: "Une erreur est survenue lors de la récupération des demandes",
});
}
watch(
[sortState, limitState, currentPageState],
async ([sortValue, limitValue, currentPageValue]) => {
Expand Down

0 comments on commit 49007c4

Please sign in to comment.