Skip to content

Commit

Permalink
Fix: url api (#222)
Browse files Browse the repository at this point in the history
* fix url api

* fix return function pour renvoyer les données codeCommune, codeRegon etc..
  • Loading branch information
Ornella452 authored Sep 24, 2024
1 parent c247614 commit 65483c0
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ VITE_APP_CANDIDAT_URL=https://candidat.conseiller-numerique.gouv.fr/login
VITE_APP_FORMS_URL=https://app.conseiller-numerique.gouv.fr/candidature
VITE_APP_AIDE_URL=https://aide.conseiller-numerique.gouv.fr/fr
VITE_APP_API_URL=http://localhost:8080
VITE_APP_API_PILOTAGE_URL=http://localhost:8080
1 change: 1 addition & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
envkey_VITE_APP_FORMS_URL: https://app.conseiller-numerique.gouv.fr/candidature
envkey_VITE_APP_AIDE_URL: https://aide.conseiller-numerique.gouv.fr/fr
envkey_VITE_APP_API_URL: ${{ secrets.REACT_APP_API_PRODUCTION }}
envkey_VITE_APP_API_PILOTAGE_URL: ${{ secrets.REACT_APP_API_PILOTAGE_PRODUCTION }}
file_name: .env
- name: Build application
run: npm run build
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy-recette.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
envkey_VITE_APP_FORMS_URL: https://uat-cnum-front.osc-fr1.scalingo.io/candidature
envkey_VITE_APP_AIDE_URL: https://aide.conseiller-numerique.gouv.fr/fr
envkey_VITE_APP_API_URL: ${{ secrets.REACT_APP_API_RECETTE }}
envkey_VITE_APP_API_PILOTAGE_URL: ${{ secrets.REACT_APP_API_PILOTAGE_RECETTE }}
file_name: .env
- name: Copy robots.txt
uses: canastro/copy-file-action@master
Expand Down
7 changes: 4 additions & 3 deletions src/views/candidature-conseiller/useApiAdmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const useApiAdmin = () => {
const { getVilleParCode } = useGeoApi();

const creerCandidatureConseiller = async conseillerData => {
const baseUrl = import.meta.env.VITE_APP_API_URL;
const baseUrl = import.meta.env.VITE_APP_API_PILOTAGE_URL;
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
Expand All @@ -19,7 +19,7 @@ export const useApiAdmin = () => {
};

const creerCandidatureStructure = async structureData => {
const baseUrl = import.meta.env.VITE_APP_API_URL;
const baseUrl = import.meta.env.VITE_APP_API_PILOTAGE_URL;
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
Expand All @@ -34,7 +34,7 @@ export const useApiAdmin = () => {
};

const creerCandidatureCoordinateur = async structureData => {
const baseUrl = import.meta.env.VITE_APP_API_URL;
const baseUrl = import.meta.env.VITE_APP_API_PILOTAGE_URL;
const requestOptions = {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
Expand Down Expand Up @@ -109,6 +109,7 @@ export const useApiAdmin = () => {
const codePostal = structureData.adresse.match(/\d{5}/)?.[0];
await handleInformationsVille(structureData, codePostal);
delete structureData.adresse;
return structureData;
};

const buildStructureData = async (formData, geoLocation) => {
Expand Down
2 changes: 1 addition & 1 deletion src/views/candidature-structure/useEntrepriseFinder.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const useEntrepriseFinder = setGeoLocation => {
}
setLoading(true);
try {
const baseUrl = import.meta.env.VITE_APP_API_URL;
const baseUrl = import.meta.env.VITE_APP_API_PILOTAGE_URL;
const response = await fetch(`${baseUrl}/structure/verify-siret-or-ridet/${siretOrRidet}`);
if (!response.ok) {
throw new Error(`Error fetching data: ${response.statusText}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const useApiConfirmationEmailCandidatureConseiller = () => {


const actionConfirmationEmailCandidatureConseiller = async token => {
const baseUrl = import.meta.env.VITE_APP_API_URL;
const baseUrl = import.meta.env.VITE_APP_API_PILOTAGE_URL;
const requestOptions = {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const useApiConfirmationEmailCandidatureStructure = () => {

const actionConfirmationEmailCandidatureStructure = async token => {
const baseUrl = import.meta.env.VITE_APP_API_URL;
const baseUrl = import.meta.env.VITE_APP_API_PILOTAGE_URL;
const requestOptions = {
method: 'PATCH',
headers: { 'Content-Type': 'application/json' },
Expand Down

0 comments on commit 65483c0

Please sign in to comment.