Skip to content
This repository was archived by the owner on Mar 22, 2025. It is now read-only.

Commit 56cd257

Browse files
authored
Merge pull request #8 from crab85193/develop
API URLを直指定して本番環境でのundefined問題を解消
2 parents 137b795 + d68ce65 commit 56cd257

File tree

6 files changed

+5
-7
lines changed

6 files changed

+5
-7
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
- name: Make envfile
1414
uses: SpicyPizza/create-envfile@v2.0
1515
with:
16-
envkey_REACT_APP_YUMEMI_API_URL: ${{ secrets.YUMEMI_API_URL }}
1716
envkey_REACT_APP_YUMEMI_API_KEY: ${{ secrets.YUMEMI_API_KEY }}
1817
directory: ./
1918
file_name: .env

.github/workflows/deploy-ph-pages.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
- name: Make envfile
2323
uses: SpicyPizza/create-envfile@v2.0
2424
with:
25-
envkey_REACT_APP_YUMEMI_API_URL: ${{ secrets.YUMEMI_API_URL }}
2625
envkey_REACT_APP_YUMEMI_API_KEY: ${{ secrets.YUMEMI_API_KEY }}
2726
directory: ./
2827
file_name: .env

src/api/population.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const fetchPopulation = async (
66
): Promise<PopulationCategory[]> => {
77
try {
88
const response = await axios.get<PopulationResponse>(
9-
`${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/population/composition/perYear?prefCode=${prefCode}`,
9+
`https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/population/composition/perYear?prefCode=${prefCode}`,
1010
{
1111
headers: {
1212
"X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY!,

src/api/prefectures.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Prefecture } from "../types/prefecture";
44
export const fetchPrefectures = async (): Promise<Prefecture[]> => {
55
try {
66
const response = await axios.get(
7-
`${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/prefectures`,
7+
`https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/prefectures`,
88
{
99
headers: { "X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY },
1010
}

src/tests/population.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe("fetchPopulation", () => {
3030

3131
expect(result).toEqual(mockData);
3232
expect(mockedAxios.get).toHaveBeenCalledWith(
33-
`${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/population/composition/perYear?prefCode=${prefCode}`,
33+
`https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/population/composition/perYear?prefCode=${prefCode}`,
3434
{
3535
headers: {
3636
"X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY!,
@@ -48,7 +48,7 @@ describe("fetchPopulation", () => {
4848
"Error fetching population data: Error: API Error"
4949
);
5050
expect(mockedAxios.get).toHaveBeenCalledWith(
51-
`${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/population/composition/perYear?prefCode=${prefCode}`,
51+
`https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/population/composition/perYear?prefCode=${prefCode}`,
5252
{
5353
headers: {
5454
"X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY!,

src/tests/prefectures.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("fetchPrefectures", () => {
2121

2222
expect(result).toEqual(mockData);
2323
expect(mockedAxios.get).toHaveBeenCalledWith(
24-
`${process.env.REACT_APP_YUMEMI_API_URL}/api/v1/prefectures`,
24+
`https://yumemi-frontend-engineer-codecheck-api.vercel.app/api/v1/prefectures`,
2525
{
2626
headers: { "X-API-KEY": process.env.REACT_APP_YUMEMI_API_KEY },
2727
}

0 commit comments

Comments
 (0)