Skip to content

Commit 23648bb

Browse files
committed
API GPU - Ne pas exposer les EPCI sans compétences
fix #1213
1 parent 3844b0f commit 23648bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nuxt/server-middleware/urba.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,12 @@ app.get('/exports/prescriptions', async (req, res) => {
105105
})
106106

107107
app.get('/exports/gpu/maillages', async (req, res) => {
108-
const allCollectivites = [...allCommunes, ...groupements]
108+
const groupementsCompetents = groupements.filter(
109+
groupement => groupement.competencePLU || groupement.competenceSCOT
110+
)
111+
const collectivites = [...allCommunes, ...groupementsCompetents]
109112

110-
const mapedCommunes = allCollectivites.map((c) => {
113+
const mapedCommunes = collectivites.map((c) => {
111114
const parents = []
112115
if (c.departementCode) {
113116
parents.push(c.departementCode)

0 commit comments

Comments
 (0)