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

tswagger 연동 및 react-query 예시코드 작성 #66

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

yeynii
Copy link
Contributor

@yeynii yeynii commented Nov 16, 2023

🐶 개요

tswagger를 연동하여 api fetch 구문과 type을 생성하고
생성된 코드를 이용한 react-query hook 예시코드를 작성했어요.

🐱 설명

  • yarn tswagger로 실행해주세요.
  • 지금은 swagger json에 명시된 스키마 타입에 오류가 있어 src/apis/apiGenerator/types.ts에 syntax에러가 발생하는 부분이 있어요.
    image
    그래서 이부분은 일단 제가 임의로 수정해뒀는데, 백엔드분들이 해결해주시리라 믿어 의심치 않아요~^-^
  • 개발환경에서는 api요청시 proxy로 cors, mixed-content 우회하도록 설정 해뒀어요.

🏞️ 스크린샷

(예시) GET /api/v1/users 는 다음과 같이 호출할 수 있어요.
스크린샷 2023-11-16 오후 1 31 54
image

🤔 참고사항

  • 현재 api 정상호출은 개발환경에서만 가능해요. https(fe)-http(be) 호출, cors 이슈로...
    👆@0ne6yte/be-team ssl 설정, 액세스 허용 origin에 https://life-4-cut.netlify.app 넣어주세용

@yeynii yeynii self-assigned this Nov 16, 2023
@yeynii yeynii requested a review from a team as a code owner November 16, 2023 05:02
@yeynii yeynii requested review from dohun31 and bullmouse and removed request for a team November 16, 2023 05:02
Copy link

netlify bot commented Nov 16, 2023

Deploy Preview for life-4-cut ready!

Name Link
🔨 Latest commit 58b542e
🔍 Latest deploy log https://app.netlify.com/sites/life-4-cut/deploys/6555a5e4798c4800089e6246
😎 Deploy Preview https://deploy-preview-66--life-4-cut.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Nov 16, 2023

@yeynii yeynii added Config ⚙️ 환경 설정 Docs 📋 문서 Feature 🎡 기능 구현 labels Nov 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Config ⚙️ 환경 설정 Docs 📋 문서 Feature 🎡 기능 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant