Skip to content

Commit

Permalink
fix(ehebrgements): refacto 2 read
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminDNUM committed Nov 19, 2024
1 parent f47ce10 commit 078537f
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions packages/backend/src/services/Hebergement.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,15 @@ ${new Array(nbRows)
],
getByUserId: `
SELECT
id,
nom,
coordonnees#> '{adresse, departement}' as departement,
coordonnees#> '{adresse, label}' as adresse,
supprime,
created_at as "createdAt",
edited_at as "editedAt"
h.id as "id",
nom as "nom",
a.label,
a.departement
FROM front.hebergement h
JOIN front.user_organisme uo ON uo.org_id = h.organisme_id
WHERE uo.use_id = $1 AND CURRENT IS TRUE
LEFT JOIN front.user_organisme uo ON uo.org_id = h.organisme_id
LEFT JOIN front.adresse a ON a.id = h.adresse_id
WHERE uo.use_id = 1
AND CURRENT IS TRUE
`,
getPreviousValueForHistory: `
SELECT
Expand Down

0 comments on commit 078537f

Please sign in to comment.