Added new DILA api route to get mairie info #1722
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The api used to get "mairie" information (name, email, telephone and opening hours) is now deprecated : https://api.gouv.fr/les-api/api_etablissements_publics (deprecated)
The new API to use is the one from the DILA : https://api.gouv.fr/les-api/api-annuaire-administration-services-publics
Enhancement
This PR :
How to test
1- Clone this branch and start the app
2- Scroll down the main page in the section "Obtenez des informations sur les adresses d’une commune" and search for any "commune". Select a "commune" : it will open the "commune" page with all the related info. (exemple for "Bordeaux" :
localhost:5000/commune/33063
<= adapt the port if you are running the app on another port than5000
)3- Scroll down the "commune" page to the section "Contacter la commune" and click on the button "Contacter la mairie".
4- It opens a modal with the "mairie" information : name, email, phone number and opening hours
5- You can also go to the "contact" page :
http://localhost:5000/nous-contacter
<= adapt the port if you are running the app on another port than5000
6- Click on the button : "Je suis un particulier ou une entreprise et j’ai constaté une adresse manquante ou incorrecte."
7- In the search field, enter a "commune" and click on the selected one.
8- It should display the "mairie" information also.