Skip to content

Commit 739adf6

Browse files
committed
Merge branch 'develop' of https://github.com/Leets-Official/SEEAT-FE into feat/#70/레벨페이지-api-연결
2 parents 934c2e0 + c9a03e7 commit 739adf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+775
-411
lines changed

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"@tanstack/react-query-devtools": "^5.84.1",
1616
"axios": "^1.11.0",
1717
"clsx": "^2.1.1",
18+
"lodash": "^4.17.21",
1819
"lottie-react": "^2.4.1",
1920
"react": "^19.1.0",
2021
"react-dom": "^19.1.0",
@@ -29,6 +30,7 @@
2930
"@eslint/js": "^9.29.0",
3031
"@svgr/cli": "^8.1.0",
3132
"@tailwindcss/vite": "^4.1.11",
33+
"@types/lodash": "^4.17.20",
3234
"@types/node": "^24.0.7",
3335
"@types/react": "^19.1.8",
3436
"@types/react-dom": "^19.1.6",

src/api/feedback/feedback.api.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import api from '@/api/api';
2+
3+
interface FeedbackRequest {
4+
feedbackContent: string;
5+
}
6+
7+
export const postFeedback = async (body: FeedbackRequest) => {
8+
const res = await api.post('/feedback', body);
9+
return res.data;
10+
};

src/api/image/image.api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ const uploadToS3 = async (url: string, file: File): Promise<void> => {
3636
});
3737
};
3838

39-
export { getPresignedUrls, uploadToS3 };
39+
export { getPresignedUrls, uploadToS3 };

src/api/profile/profile.api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ export const getUserProfile = async (): Promise<UserProfile> => {
1111
console.error('프로필 로딩 에러:', apiError);
1212
throw apiError;
1313
}
14-
};
14+
};

src/api/review/myBookmark.api.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import api from '@/api/api';
2+
import type { PaginatedBookmarkResponse } from '@/types/review';
3+
4+
interface PageRequest {
5+
page: number;
6+
size: number;
7+
}
8+
9+
export const getMyBookmarks = async (
10+
params: PageRequest
11+
): Promise<PaginatedBookmarkResponse> => {
12+
const res = await api.get('/profile/bookmark', { params });
13+
return res.data.data;
14+
};

src/api/review/myReview.api.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import api from '@/api/api';
2+
import type { ReviewItem } from '@/types/review';
3+
4+
interface PageRequest {
5+
page: number;
6+
size: number;
7+
}
8+
9+
interface PaginatedReviewResponse {
10+
content: ReviewItem[];
11+
page: number;
12+
size: number;
13+
totalPages: number;
14+
totalElements: number;
15+
}
16+
17+
export const getMyReviews = async (
18+
params: PageRequest
19+
): Promise<PaginatedReviewResponse> => {
20+
const res = await api.get('/profile/reviews', { params });
21+
return res.data.data;
22+
};

src/api/review/review.ts

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/api/user/userEdit.api.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import api from '@/api/api';
2+
import type { ApiResponse } from '@/types/api-response';
3+
import type { UpdateUserProfileRequest, UserProfileResponse } from '@/types/userEdit';
4+
5+
export const updateUserProfile = async (
6+
data: UpdateUserProfileRequest
7+
): Promise<UserProfileResponse> => {
8+
const response = await api.patch<ApiResponse<UserProfileResponse>>('/profile', data);
9+
return response.data.data;
10+
};

src/api/user/users.api.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,26 @@ export const postRegister = async (
1818
'Temp-User-Key': tempUserKey,
1919
},
2020
});
21+
22+
const accessToken = response.headers['authorization'] || response.headers['Authorization'];
23+
console.log('accessToken : ', response.headers);
24+
25+
if (!accessToken) {
26+
throw new Error('accessToken이 응답 헤더에 없습니다.');
27+
}
28+
29+
localStorage.setItem('accessToken', accessToken.replace('Bearer ', ''));
30+
2131
return response.data;
2232
};
2333

2434
// 로그아웃
35+
36+
// 닉네임 중복 검사
37+
export const checkNicknameDuplicate = async (nickname: string) => {
38+
const res = await api.get('/users', {
39+
params: { nickname },
40+
});
41+
42+
return res.data.data;
43+
};

0 commit comments

Comments
 (0)