Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: url api #222

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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