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

프론트엔드 4주차 배포 코드 #246

Merged
merged 128 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
128 commits
Select commit Hold shift + click to select a range
8294235
[FE][Feat] #59 : Modal 열고 닫기 hook
juwon5272 Nov 16, 2024
9252556
[FE][Feat] #59 : Modal header 컴포넌트
juwon5272 Nov 16, 2024
de79934
[FE][Feat] #59 : Modal Input 컴포넌트
juwon5272 Nov 16, 2024
6949fbe
[FE][Feat] #59 : Modal Footer 컴포넌트
juwon5272 Nov 16, 2024
8f661c3
[FE][Feat] #59 : Modal 컴포넌트
juwon5272 Nov 16, 2024
33c586d
[FE][Feat] #59 : Modal 컴포넌트를 사용 로그인/회원가입 모달
juwon5272 Nov 16, 2024
5d150b9
[FE][Docs] #59 : Modal Header Storybook
juwon5272 Nov 16, 2024
1b04582
[FE][Docs] #59 : Modal Footer Storybook
juwon5272 Nov 16, 2024
27bef3f
[FE][Docs] #59 : Modal Input Storybook
juwon5272 Nov 16, 2024
35bbc55
[FE][Docs] #59 : Modal Storybook
juwon5272 Nov 16, 2024
6bd55e6
[FE][Docs] #59 : AuthModal Storybook
juwon5272 Nov 16, 2024
4acfa6c
[FE][Refactor] : Dropdown 토글 전환 로직 이벤트 넘겨주게 수정
effozen Nov 16, 2024
2c98f38
[FE][Feat][Fix] : Header 컴포넌트 외부에서 Dropdown Item 인자 받을 수 있는 기능 추가 및 아…
effozen Nov 16, 2024
b1f6875
[ENV][Fix] #1 : auto-assign 라벨 바뀔때마다 되는 문제 수정
effozen Nov 16, 2024
1baf6e3
[ENV][Fix] #1 : auto-assign 라벨 바뀔때마다 되는 문제 재수정
effozen Nov 16, 2024
f17994a
[ENV][Fix] #1 : auto-merge 정상적으로 동작안되는 문제 수정
effozen Nov 16, 2024
a7e2d1f
Merge pull request #180 from boostcampwm-2024/feature/env/#1-auto-mer…
effozen Nov 17, 2024
fe41f0c
Merge pull request #179 from boostcampwm-2024/feature/env/#1-auto-ass…
effozen Nov 17, 2024
f455eaa
Merge pull request #178 from boostcampwm-2024/feature/fe/#112-compone…
effozen Nov 17, 2024
84bcf5c
[FE][Feat] #145 : 스토리북을 위한 구조 변경 및 스토리 작성
leedongyull Nov 17, 2024
c44161b
[ENV][Docs] : README.md 위키와 노션 순서 변경
effozen Nov 17, 2024
b111a4f
[FE][Docs] : 스토리북 초기 페이지 변경
effozen Nov 17, 2024
3419ceb
[FE][Docs] : 스토리북 디렉토리 구조 수정
effozen Nov 17, 2024
557873c
Merge pull request #177 from boostcampwm-2024/feature/fe/#59-modal-login
juwon5272 Nov 17, 2024
4c49469
[FE][Fix] : Dropdown 버튼 useContext로 인한 순환 참조 문제 해결
effozen Nov 17, 2024
66a14e8
[FE][Docs] #112 : Storybook 및 TSDoc 작성
effozen Nov 17, 2024
2361010
[FE] : frontend 브렌치와 머지
effozen Nov 17, 2024
795b38d
Merge pull request #181 from boostcampwm-2024/feature/fe/#112-storybook
effozen Nov 18, 2024
7649e8f
[FE] : main branch merge
effozen Nov 18, 2024
fd0f98d
[FE][Feat] #145 : 스토리북 수정
leedongyull Nov 18, 2024
00e69b2
[FE][Rename] #145 : 폴더 명 카멜케이스로 변경
leedongyull Nov 18, 2024
158631b
[FE][Feat] #186 : 공통 함수 세팅
happyhyep Nov 18, 2024
9fd2f57
[FE][Feat] #186 : 공통 함수 세팅
happyhyep Nov 18, 2024
7ae65bd
Merge branch 'refs/heads/frontend' into feature/fe/#197-doLogin
happyhyep Nov 18, 2024
efe3fb8
[FE][Style] #184 : 헤더 z-index 수정
effozen Nov 18, 2024
8275109
[FE][Style] #184 : canvas랑 지도 겹쳐서 보이는 레이아웃 구현
effozen Nov 18, 2024
164fecd
[ENV][test] : 프로젝트 전체에 테스트 코드 없을 떄 CI 오류나는 것 방지용 더미 테스트 도구
effozen Nov 18, 2024
189e7ff
[FE][Feat] #197 : 로그인 api 연동
happyhyep Nov 18, 2024
e5eb0f4
[FE][Feat] #4 : 캔버스에 선그리기 훅
juwon5272 Nov 18, 2024
71c8928
[FE][Feat] #4 : 캔버스에서 panning 훅
juwon5272 Nov 18, 2024
61b5718
[FE][Feat] #4 : 캔버스에 마우스 휠로 확대 및 축소 훅
juwon5272 Nov 18, 2024
acfc1b4
[FE][Feat] #4 : 분리한 훅에 맞게 컴포넌트 변경
juwon5272 Nov 18, 2024
2ae0593
[FE][Feat] #4 : 찍은 점이 1개일 경우 점이 찍히게 구현
juwon5272 Nov 18, 2024
a7aafa3
[FE][Feat] #194 : userBoard UI 구현
leedongyull Nov 18, 2024
2e6e4bb
[FE][Docs] #194 : userBoard tsDoc 작성
leedongyull Nov 18, 2024
068052c
[FE][Feat] #194 : userBoard Storybook 작성
leedongyull Nov 18, 2024
b8ca237
[FE][Feat] #201 : undo redo 버튼 구현
juwon5272 Nov 18, 2024
20866ae
Merge branch 'feature/fe/#4-drawroute' of https://github.com/boostcam…
leedongyull Nov 18, 2024
0dd16f0
[FE][Feat] #204 : 마커 아이콘으로 변경중
leedongyull Nov 19, 2024
6667627
[FE][Refactor] #4 : 확대/축소 상수 변수화
juwon5272 Nov 19, 2024
13e12d8
[FE][Refactor] #4 : 네이버지도 확대/축소 배열 변수화
juwon5272 Nov 19, 2024
d020180
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Nov 19, 2024
f7147a3
Merge branch 'feature/fe/#204-addMarker' of https://github.com/boostc…
leedongyull Nov 19, 2024
1f079a2
[FE][Refactor] #4 : Linedrawer 매개변수 수정
juwon5272 Nov 19, 2024
2c74b11
[FE][Feat] : 네이버 지도 끝 점 찾아오는 유틸 구현
effozen Nov 19, 2024
cfa9bf8
Merge pull request #200 from boostcampwm-2024/feature/fe/#194-userboard
leedongyull Nov 19, 2024
e961153
Merge pull request #192 from boostcampwm-2024/feature/fe/#145-storybook
leedongyull Nov 19, 2024
af80c15
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Nov 19, 2024
3d77902
Merge pull request #199 from boostcampwm-2024/feature/fe/#197-doLogin
happyhyep Nov 19, 2024
8cf2f25
Merge pull request #195 from boostcampwm-2024/feature/fe/#186-axiosTe…
happyhyep Nov 19, 2024
82baf16
Merge pull request #198 from boostcampwm-2024/feature/fe/#184-map-and…
effozen Nov 19, 2024
bbeaae6
[FE][Feat] #204 : context, canvas 내부 스코프에서 가져오기
leedongyull Nov 19, 2024
f5120dc
[FE][Feat] #204 : 테스트용 파일 원래대로 되돌리기
leedongyull Nov 19, 2024
70ba192
Merge pull request #205 from boostcampwm-2024/feature/fe/#4-drawroute
juwon5272 Nov 19, 2024
48f690f
Merge branch 'frontend' of https://github.com/boostcampwm-2024/web28-…
leedongyull Nov 19, 2024
4f20c35
Merge branch 'frontend' into feature/fe/#204-addMarker
leedongyull Nov 19, 2024
8c7f056
[FE][Feat] #204 : Initial zoom index 상수화
leedongyull Nov 19, 2024
a23b7d2
Merge branch 'feature/fe/#204-addMarker' of https://github.com/boostc…
leedongyull Nov 19, 2024
5676020
Merge pull request #209 from boostcampwm-2024/feature/fe/#204-addMarker
leedongyull Nov 19, 2024
963597f
[FE][Design] #14 : z-index 조절
juwon5272 Nov 19, 2024
b788c7f
[FE][Design] #14 : 불필요한 선 삭제
juwon5272 Nov 19, 2024
d1f4426
[FE][Feat] #14 : 바텀시트 열림/닫힘 2단계 대신 끌어올린만큼 올라오도록 변경
juwon5272 Nov 19, 2024
8b891f6
[FE][Feat] : 캔버스와 지도가 겹쳐보일 때 지도를 클릭할 수 없는 문제 구현.
effozen Nov 19, 2024
e3a7906
[FE][Style] #14 : 불필요한 코드 삭제
juwon5272 Nov 20, 2024
ba9f11c
[FE][Design] #14 : 바텀시트 최저 높이 변경
juwon5272 Nov 20, 2024
4e3d144
[FE][Feat] #88 : 시작점과 도착점 마커를 찍기 위한 모드 추가
juwon5272 Nov 20, 2024
faa846e
[FE][Feat] #88 : Floating Button 적용
juwon5272 Nov 20, 2024
071f4d7
[FE][Feat] #88 : startpoint와 endpoint에 marker 이미지 넣기
juwon5272 Nov 20, 2024
828d317
[FE][Refactor] : 미사용 코드 삭제
juwon5272 Nov 20, 2024
68070b0
Merge pull request #212 from boostcampwm-2024/feature/fe/#14-bottomsheet
juwon5272 Nov 20, 2024
bc6ec67
[FE][Chore] : ESLint a11y event 오류 -> 경고로 수정
effozen Nov 20, 2024
8e73169
[FE][Feat] #191 : 겹쳐있는 캔버스와 지도에 이벤트가 발생했을 경우 동시에 반응하는 로직 구현
effozen Nov 20, 2024
9bc19a1
[FE] : Frontend branch merge
effozen Nov 20, 2024
e2b978c
[FE][Fix] : storybook 오류 해결
juwon5272 Nov 20, 2024
6ac35fb
[FE][Rename] : 파일명 소문자로 통일
juwon5272 Nov 20, 2024
5b8e5f5
Merge pull request #217 from boostcampwm-2024/feature/fe/#88-addmarker
effozen Nov 20, 2024
6651d56
Merge pull request #216 from boostcampwm-2024/feature/fe/#187-get-ver…
effozen Nov 20, 2024
859c452
[FE][Feat] #106 : Footer 구조 변경
leedongyull Nov 20, 2024
aa71e7b
[FE][Feat] #106 : addChannel로 이동이 가능하도록 변경, footer 비활성화 디자인 변경
leedongyull Nov 20, 2024
e202995
[FE][Feat] #106 : 경로 설정으로 이동 구현
leedongyull Nov 20, 2024
be19cd1
[FE][Feat] #106 : draw페이지 header 및 footer 설정
leedongyull Nov 20, 2024
f6cb239
[FE][Feat] #106 : 뒤로가기 버튼 Context 초기화 기능 추가
leedongyull Nov 20, 2024
e72aaec
[FE][Feat] #106 : 사용자 추가 로컬스토리지로 유지
leedongyull Nov 20, 2024
b19b0a1
[FE][Feat] Header 상수화
leedongyull Nov 21, 2024
b6031ee
[FE][Feat][Fix] #191 : 지도 객체 로딩 오류 수정 및 드래그 이동 이벤트 구현
effozen Nov 21, 2024
d9e0eac
[FE] : Frontend branch merge
effozen Nov 21, 2024
416271e
[ENV][Chore] #1 : auto-merge 삭제
effozen Nov 21, 2024
5f2d452
Merge pull request #218 from boostcampwm-2024/feature/fe/#106-add-cha…
effozen Nov 21, 2024
e0fe6db
Merge pull request #223 from boostcampwm-2024/feature/fe/#187-get-ver…
effozen Nov 21, 2024
c786174
[FE][Feat] #222 : 회원가입 api 연동
happyhyep Nov 21, 2024
67c44df
[FE][Feat] #226 : 채널 생성 api 연동
happyhyep Nov 21, 2024
d4b4829
[FE][Feat] #211 : 사용자 id로 채널 가져오기 api
happyhyep Nov 21, 2024
fdd2758
[FE][Feat] #106 : 위도 경도 주소로 변환 및 user 컨텍스트로 관리
leedongyull Nov 21, 2024
6c2b6ca
[FE][Feat] #106 : context 이용해서 footer 버튼 활성화 기능 구현
leedongyull Nov 21, 2024
b8fa8b4
[FE][Feat] #106 : mock데이터로 Route 설정 구현
leedongyull Nov 21, 2024
fac9b5c
[FE][Fix] #155 : 폰트 안되는 이슈 해결
happyhyep Nov 21, 2024
f248090
[FE][Feat] #106 : active enum 설정 및 mock데이터로 테스트 추가
leedongyull Nov 21, 2024
12efc9b
[FE][Chore] #234 : 페이지 초기 세팅
happyhyep Nov 21, 2024
015847b
[FE][Fix] #106 : 틀린 문법 고침
leedongyull Nov 21, 2024
57e40ec
[FE][Fix] #106 : footerActive 상태 수정
leedongyull Nov 21, 2024
be0fd8f
[FE][Feat] #224 : 캔버스와 지도 연동
effozen Nov 21, 2024
5527c2b
Merge pull request #235 from boostcampwm-2024/feature/fe/#234-setting…
happyhyep Nov 21, 2024
b9f460a
[FE][Fix] #224 : 코드 경로 에러 수정
effozen Nov 21, 2024
0a684a4
Merge pull request #236 from boostcampwm-2024/feature/fe/#224-combine…
effozen Nov 21, 2024
074b9e1
[FE][Fix] #224 : Frontend 버그 수정
effozen Nov 21, 2024
f625782
Merge pull request #228 from boostcampwm-2024/feature/fe/#226-createC…
happyhyep Nov 21, 2024
59412ea
Merge pull request #227 from boostcampwm-2024/feature/fe/#222-registe…
happyhyep Nov 21, 2024
26cc602
Merge pull request #239 from boostcampwm-2024/feature/fe/#211-getChan…
happyhyep Nov 21, 2024
43bbb0f
Merge pull request #238 from boostcampwm-2024/feature/fe/#224-combine…
effozen Nov 21, 2024
31fd1fe
Merge branch 'frontend' into feature/fe/#106-add-channel
happyhyep Nov 21, 2024
aacc328
Merge pull request #237 from boostcampwm-2024/feature/fe/#106-add-cha…
effozen Nov 21, 2024
caec07c
[FE][Fix] vite 경로 오류 해결
happyhyep Nov 21, 2024
febc9ab
[FE][Fix] #224 : 네이버 지도 샘플 코드 작성
effozen Nov 21, 2024
1aadab1
Merge branch 'frontend' into feature/fe/#224-combine-map-and-canvas
effozen Nov 21, 2024
8d6f0a2
Merge pull request #244 from boostcampwm-2024/feature/fe/#224-combine…
happyhyep Nov 21, 2024
2125356
[FE][Feat] Main.tsx 화면에서 4주차 데모를 위한 실시간 현재 위치 받아오는 기능 추가
happyhyep Nov 21, 2024
9c93848
Merge pull request #245 from boostcampwm-2024/feature/fe/4week-dev-test
happyhyep Nov 21, 2024
66099e0
[FE][Chore] 프론트엔드 4주차 배포
happyhyep Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/workflows/auto-assign-reviewers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: 'Auto Assign Reviewers'

on:
pull_request:
types: [opened, labeled]
types: [opened]

jobs:
assign_reviewers:
Expand Down Expand Up @@ -43,12 +43,13 @@ jobs:
with:
script: |
const targetBranch = context.payload.pull_request.base.ref;
const reviewers = targetBranch === 'main' ? 3 : 2;
core.setOutput('number_of_reviewers', reviewers);
const reviewers = (targetBranch === 'main' || targetBranch === 'development') ? 3 : 2;
return { number_of_reviewers: reviewers };

- name: 'Assign Reviewers'
uses: kentaro-m/[email protected]
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
configuration-path: '.github/auto_assign_config.yml'
numberOfReviewers: ${{ steps.determine_reviewers.outputs.number_of_reviewers }}

69 changes: 0 additions & 69 deletions .github/workflows/auto-merge.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
## 🗝 링크 안내

<p>
<a href="https://www.notion.so/127b1b2b649180e88f70d6a4648924a0?pvs=4">팀 노션</a> |
<a href="https://ddara-docs.vercel.app/">팀 위키</a> |
<a href="https://www.notion.so/127b1b2b649180e88f70d6a4648924a0?pvs=4">팀 노션</a> |
<a href="https://www.figma.com/design/r9nl4Jcz9VXIMbrpf50wY6/PickMeUp?node-id=90-1897">기획서</a> |
<a href="https://www.figma.com/design/r9nl4Jcz9VXIMbrpf50wY6/PickMeUp?node-id=87-929">디자인</a>
<!-- <br />
Expand Down
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ export default [
'no-underscore-dangle': 'warn',
'no-undef': 'off',
'arrow-body-style': 'off',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
},
},

Expand Down
6 changes: 3 additions & 3 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!doctype html>
<html lang="en">
<html lang="ko">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" href="/assets/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>선따라 길따라 - DDara</title>
</head>
<body>
<div id="root"></div>
Expand Down
134 changes: 67 additions & 67 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
{
"name": "ddara-frontend",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"lint": "pnpm lint-staged",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@fontsource/pretendard": "^5.1.0",
"axios": "^1.7.7",
"lz-string": "^1.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-router-dom": "^6.28.0",
"uuid": "^11.0.3"
},
"devDependencies": {
"@chromatic-com/storybook": "^3.2.2",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/addon-onboarding": "^8.4.2",
"@storybook/blocks": "^8.4.2",
"@storybook/react": "^8.4.2",
"@storybook/react-vite": "^8.4.2",
"@storybook/test": "^8.4.2",
"@types/navermaps": "^3.7.8",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"classnames": "^2.5.1",
"eslint": "^9.13.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
"globals": "^15.11.0",
"postcss": "^8.4.47",
"storybook": "^8.4.2",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vite-tsconfig-paths": "^5.1.1"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
}
}
{
"name": "ddara-frontend",
"private": true,
"workspaces": [
"frontend",
"backend"
],
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"test": "vitest",
"test:watch": "vitest --watch",
"test:coverage": "vitest run --coverage",
"lint": "pnpm lint-staged",
"preview": "vite preview",
"storybook": "storybook dev -p 6006",
"build-storybook": "storybook build"
},
"dependencies": {
"@fontsource/pretendard": "^5.1.0",
"axios": "^1.7.7",
"lz-string": "^1.5.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "^5.3.0",
"react-router-dom": "^6.28.0",
"uuid": "^11.0.3"
},
"devDependencies": {
"@chromatic-com/storybook": "^3.2.2",
"@eslint/js": "^9.13.0",
"@storybook/addon-essentials": "^8.4.2",
"@storybook/addon-interactions": "^8.4.2",
"@storybook/addon-onboarding": "^8.4.2",
"@storybook/blocks": "^8.4.2",
"@storybook/react": "^8.4.2",
"@storybook/react-vite": "^8.4.2",
"@storybook/test": "^8.4.2",
"@types/navermaps": "^3.7.8",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react-router-dom": "^5.3.3",
"@vitejs/plugin-react-swc": "^3.5.0",
"autoprefixer": "^10.4.20",
"classnames": "^2.5.1",
"eslint": "^9.13.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-react-refresh": "^0.4.14",
"eslint-plugin-storybook": "^0.11.0",
"globals": "^15.11.0",
"postcss": "^8.4.47",
"storybook": "^8.4.2",
"tailwindcss": "^3.4.14",
"typescript": "~5.6.2",
"typescript-eslint": "^8.11.0",
"vite": "^5.4.10",
"vite-tsconfig-paths": "^5.1.1"
},
"eslintConfig": {
"extends": [
"plugin:storybook/recommended"
]
}
}
9 changes: 9 additions & 0 deletions frontend/public/assets/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions frontend/src/api/auth.api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { getApiClient } from '@/api/client.api.ts';
import { ResponseDto } from '@/api/dto/response.dto.ts';
import { LoginResEntity, RegisterResEntity } from '@/api/dto/auth.dto.ts';

export const doLogin = (id: string, password: string): Promise<ResponseDto<LoginResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<LoginResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.post('/auth/login', { id, password })
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<LoginResEntity>(res));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};

export const doRegister = (
id: string,
name: string,
password: string,
email: string,
): Promise<ResponseDto<RegisterResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<RegisterResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.post('/auth/register', { id, name, password, email })
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<RegisterResEntity>(res));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};
57 changes: 57 additions & 0 deletions frontend/src/api/channel.api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { ResponseDto } from '@/api/dto/response.dto.ts';
import {
createChannelReqEntity,
createChannelResEntity,
getUserChannelsResEntity,
} from '@/api/dto/channel.dto.ts';
import { getApiClient } from '@/api/client.api.ts';

export const createChannel = (
data: createChannelReqEntity,
): Promise<ResponseDto<createChannelResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<createChannelResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.post('/channel', data)
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<createChannelResEntity>(res));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};

export const getUserChannels = (userId: string): Promise<ResponseDto<getUserChannelsResEntity>> => {
const promiseFn = (
fnResolve: (value: ResponseDto<getUserChannelsResEntity>) => void,
fnReject: (reason?: any) => void,
) => {
const apiClient = getApiClient();
apiClient
.get(`/channel/user/${userId}`)
.then(res => {
if (res.status !== 200) {
console.error(res);
fnReject(`msg.${res}`);
} else {
fnResolve(new ResponseDto<getUserChannelsResEntity>(res));
}
})
.catch(err => {
console.error(err);
fnReject('msg.RESULT_FAILED');
});
};
return new Promise(promiseFn);
};
Loading
Loading