Skip to content

Commit

Permalink
[FE] Hotfix:api response 변경 (#358)
Browse files Browse the repository at this point in the history
* chore: yml 변경

* refactor: kaka login url 변경
  • Loading branch information
GC-Park authored Aug 17, 2023
1 parent 39c01e4 commit fb4ac64
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/fe-merge-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ jobs:
run: npm install
working-directory: frontend

- name: 테스트 환경변수 설정
run: |
echo "REACT_APP_API_DEFAULT_DEV=${{ secrets.REACT_APP_API_DEFAULT_DEV }}" >> $GITHUB_ENV
echo "REACT_APP_API_DEFAULT_PROD=${{ secrets.REACT_APP_API_DEFAULT_PROD }}" >> $GITHUB_ENV
- name: Build project
run: npm run build
working-directory: frontend
env:
REACT_APP_API_DEFAULT_DEV: ${{ secrets.REACT_APP_API_DEFAULT_DEV }}
REACT_APP_API_DEFAULT_PROD: ${{ secrets.REACT_APP_API_DEFAULT_PROD }}

- name: upload to artifact
uses: actions/upload-artifact@v3
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/fe-merge-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,12 @@ jobs:
run: npm install
working-directory: frontend

- name: 테스트 환경변수 설정
run: |
echo "REACT_APP_API_DEFAULT_DEV=${{ secrets.REACT_APP_API_DEFAULT_DEV }}" >> $GITHUB_ENV
echo "REACT_APP_API_DEFAULT_PROD=${{ secrets.REACT_APP_API_DEFAULT_PROD }}" >> $GITHUB_ENV
- name: Build project
run: npm run build
working-directory: frontend
env:
REACT_APP_API_DEFAULT_DEV: ${{ secrets.REACT_APP_API_DEFAULT_DEV }}
REACT_APP_API_DEFAULT_PROD: ${{ secrets.REACT_APP_API_DEFAULT_PROD }}

- name: upload to artifact
uses: actions/upload-artifact@v3
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/pages/KaKaoRedirectPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ import { getApi } from '../apis/getApi';
import { keyframes, styled } from 'styled-components';
import useNavigator from '../hooks/useNavigator';

const API_URL =
process.env.NODE_ENV === 'production'
? process.env.REACT_APP_API_DEFAULT_PROD
: process.env.REACT_APP_API_DEFAULT_DEV;

export const handleOAuthKakao = async (code: string) => {
try {
const url = `https://mapbefine.kro.kr/api/oauth/login/kakao?code=${code}`;
const url = `${API_URL}/oauth/login/kakao?code=${code}`;
const data = await getApi<any>('login', url);

localStorage.setItem('userToken', data.accessToken);
Expand Down

0 comments on commit fb4ac64

Please sign in to comment.