From d68ce6521cd1313eb7a0d4e046bc56c58bbbd577 Mon Sep 17 00:00:00 2001 From: crab85193 Date: Wed, 18 Dec 2024 23:15:13 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20API=20URL=E3=82=92=E7=9B=B4=E6=8C=87?= =?UTF-8?q?=E5=AE=9A=E3=81=97=E3=81=A6=E6=9C=AC=E7=95=AA=E7=92=B0=E5=A2=83?= =?UTF-8?q?=E3=81=A7=E3=81=AEundefined=E5=95=8F=E9=A1=8C=E3=82=92=E8=A7=A3?= =?UTF-8?q?=E6=B6=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 1 - .github/workflows/deploy-ph-pages.yml | 1 - src/api/population.ts | 2 +- src/api/prefectures.ts | 2 +- src/tests/population.test.ts | 4 ++-- src/tests/prefectures.test.ts | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcc8380..b3f3bfa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,6 @@ jobs: - name: Make envfile uses: SpicyPizza/create-envfile@v2.0 with: - envkey_REACT_APP_YUMEMI_API_URL: ${{ secrets.YUMEMI_API_URL }} envkey_REACT_APP_YUMEMI_API_KEY: ${{ secrets.YUMEMI_API_KEY }} directory: ./ file_name: .env diff --git a/.github/workflows/deploy-ph-pages.yml b/.github/workflows/deploy-ph-pages.yml index aaa8178..3dc8b51 100644 --- a/.github/workflows/deploy-ph-pages.yml +++ b/.github/workflows/deploy-ph-pages.yml @@ -22,7 +22,6 @@ jobs: - name: Make envfile uses: SpicyPizza/create-envfile@v2.0 with: - envkey_REACT_APP_YUMEMI_API_URL: ${{ secrets.YUMEMI_API_URL }} envkey_REACT_APP_YUMEMI_API_KEY: ${{ secrets.YUMEMI_API_KEY }} directory: ./ file_name: .env diff --git a/src/api/population.ts b/src/api/population.ts index 009e89b..39dc801 100644 --- a/src/api/population.ts +++ b/src/api/population.ts @@ -6,7 +6,7 @@ export const fetchPopulation = async ( ): Promise => { try { const response = await axios.get( - `${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/population/composition/perYear?prefCode=${prefCode}`, + `https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/population/composition/perYear?prefCode=${prefCode}`, { headers: { "X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY!, diff --git a/src/api/prefectures.ts b/src/api/prefectures.ts index 0f5fae4..9147af5 100644 --- a/src/api/prefectures.ts +++ b/src/api/prefectures.ts @@ -4,7 +4,7 @@ import { Prefecture } from "../types/prefecture"; export const fetchPrefectures = async (): Promise => { try { const response = await axios.get( - `${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/prefectures`, + `https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/prefectures`, { headers: { "X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY }, } diff --git a/src/tests/population.test.ts b/src/tests/population.test.ts index 0a91fdb..89ff0da 100644 --- a/src/tests/population.test.ts +++ b/src/tests/population.test.ts @@ -30,7 +30,7 @@ describe("fetchPopulation", () => { expect(result).toEqual(mockData); expect(mockedAxios.get).toHaveBeenCalledWith( - `${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/population/composition/perYear?prefCode=${prefCode}`, + `https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/population/composition/perYear?prefCode=${prefCode}`, { headers: { "X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY!, @@ -48,7 +48,7 @@ describe("fetchPopulation", () => { "Error fetching population data: Error: API Error" ); expect(mockedAxios.get).toHaveBeenCalledWith( - `${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/population/composition/perYear?prefCode=${prefCode}`, + `https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/population/composition/perYear?prefCode=${prefCode}`, { headers: { "X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY!, diff --git a/src/tests/prefectures.test.ts b/src/tests/prefectures.test.ts index a0997f1..dd2f911 100644 --- a/src/tests/prefectures.test.ts +++ b/src/tests/prefectures.test.ts @@ -21,7 +21,7 @@ describe("fetchPrefectures", () => { expect(result).toEqual(mockData); expect(mockedAxios.get).toHaveBeenCalledWith( - `${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/prefectures`, + `https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/prefectures`, { headers: { "X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY }, }