Skip to content

Commit

Permalink
feat: delete bal-api legacy
Browse files Browse the repository at this point in the history
feat: delete bal-api legacy
  • Loading branch information
fufeck authored Apr 24, 2024
2 parents 4ae8c51 + 69cb39b commit c0826d9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.default
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ GHOST_KEY=
# Definition URL pour accès aux sites BAL

NEXT_PUBLIC_BAL_ADMIN_API_URL=https://bal-admin.adresse.data.gouv.fr/api
NEXT_PUBLIC_BAL_API_URL=https://api-bal.adresse.data.gouv.fr/v1
NEXT_PUBLIC_BAL_API_URL=https://api-bal.adresse.data.gouv.fr/v2
NEXT_PUBLIC_MES_ADRESSES=https://mes-adresses.data.gouv.fr

# -----------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions components/bases-locales/deploiement-bal/panel-bal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Doughnut} from 'react-chartjs-2'
import {Chart as ChartJS, ArcElement, Tooltip, Legend} from 'chart.js'

import theme from '@/styles/theme'
import {getBals, getBalsStatus} from '@/lib/mes-adresse-api'
import {getStatsBals, getBalsStatus} from '@/lib/mes-adresse-api'
import CommuneBALList from './commune-bal-list'

ChartJS.register(ArcElement, Tooltip, Legend)
Expand Down Expand Up @@ -55,7 +55,7 @@ function PanelBal({filteredCodesCommmune}) {

async function loadBals() {
const fields = ['_id', 'commune', 'status', 'nom', '_updated', 'sync']
const balsFiltered = await getBals(fields, filteredCodesCommmune)
const balsFiltered = await getStatsBals(fields, filteredCodesCommmune)
setBals(balsFiltered)
const statusData = [
balsFiltered.filter(({status}) => status === 'published').length,
Expand Down
2 changes: 1 addition & 1 deletion lib/mes-adresse-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ async function _fetch(url, method, body) {
throw new Error('Une erreur est survenue')
}

export async function getBals(fields, codesCommunes) {
export async function getStatsBals(fields, codesCommunes) {
const query = fields.map(field => `fields=${field}`)
return _fetch('/stats/bals?' + query.join('&'), 'POST', codesCommunes)
}
Expand Down

0 comments on commit c0826d9

Please sign in to comment.