From c66d75928c95233f6a2e67d0cd22b9e60603054c Mon Sep 17 00:00:00 2001 From: Noah Spannbauer Date: Mon, 25 Nov 2024 20:17:27 -0600 Subject: [PATCH] changing api to azure function app --- .github/workflows/app.yaml | 1 + app/src/hooks/httpClient/UseHttpClient.tsx | 35 ++++++++++++---------- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml index 1ec073b..6207376 100644 --- a/.github/workflows/app.yaml +++ b/.github/workflows/app.yaml @@ -14,6 +14,7 @@ jobs: runs-on: ubuntu-latest environment: ${{ inputs.calling_workflow }} env: + VITE_API_URL: ${{ secrets.VITE_API_URL }} VITE_CLIENT_ID: ${{ secrets.VITE_CLIENT_ID }} VITE_TENANT_ID: ${{ secrets.VITE_TENANT_ID }} VITE_REDIRECT_URL: ${{ secrets.VITE_REDIRECT_URL }} diff --git a/app/src/hooks/httpClient/UseHttpClient.tsx b/app/src/hooks/httpClient/UseHttpClient.tsx index 107245b..65937c1 100644 --- a/app/src/hooks/httpClient/UseHttpClient.tsx +++ b/app/src/hooks/httpClient/UseHttpClient.tsx @@ -1,22 +1,27 @@ import axios, { AxiosInstance, CreateAxiosDefaults } from 'axios'; export const useHttpClient = () => { - let config: CreateAxiosDefaults; + let config: CreateAxiosDefaults = { + baseURL: import.meta.env.VITE_API_URL, + headers: { + 'Content-Type': 'application/json' + } + }; - if (import.meta.env.DEV) { - config = { - baseURL: import.meta.env.VITE_API_URL, - headers: { - 'Content-Type': 'application/json' - } - }; - } else { - config = { - headers: { - 'Content-Type': 'application/json' - } - }; - } + // if (import.meta.env.DEV) { + // config = { + // baseURL: import.meta.env.VITE_API_URL, + // headers: { + // 'Content-Type': 'application/json' + // } + // }; + // } else { + // config = { + // headers: { + // 'Content-Type': 'application/json' + // } + // }; + // } const httpClient: AxiosInstance = axios.create(config);