Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
c51ce48
refactor: api 관련 반환 타입 구조 설정
NamgungJongMin Jan 21, 2025
047e33f
refactor: 리뷰 타입 정리
NamgungJongMin Jan 21, 2025
696bd33
refactor: createTravelFormData 유틸 함수 분리 및 BaseResponse 적용
who0803 Jan 21, 2025
5e2f3a5
fix: 여행 타입 수정
NewJiSoo Jan 21, 2025
75f76ca
refactor: 타입 이름 변경 및 BaseResponse 적용
who0803 Jan 21, 2025
84a419c
Merge branch 'refactor/type-review' of https://github.com/Team-Talkin…
who0803 Jan 21, 2025
2cf9820
refactor: 유저 타입 정리
NamgungJongMin Jan 21, 2025
ee21a55
fix: travel 타입 수정
NewJiSoo Jan 21, 2025
ac9df20
refactor: Participant 타입 리팩토링 및 User 타입 활용
who0803 Jan 21, 2025
18ef540
fix: 여행 타입 수정
NewJiSoo Jan 21, 2025
c886757
refactor: Participant 타입 Pick 적용
who0803 Jan 21, 2025
a71829c
fix: participant타입에서 omit 대신 pick으로 변경
NewJiSoo Jan 21, 2025
86ae806
refactor: Participant 타입 수정
who0803 Jan 21, 2025
334731b
Merge pull request #206 from Team-Talking-Potatoes/refactor/type-travel
NamgungJongMin Jan 21, 2025
ca3d37b
Merge pull request #204 from Team-Talking-Potatoes/refactor/type-user
NamgungJongMin Jan 21, 2025
22f21f3
Merge pull request #203 from Team-Talking-Potatoes/refactor/type-review
NamgungJongMin Jan 21, 2025
f91c727
refactor: 인증 관련 엔드포인트 변경
NamgungJongMin Jan 24, 2025
bf592d0
refactor: export 방식 변경
NamgungJongMin Jan 24, 2025
1daced6
refactor: 인증 인풋 요소 타입 재설정
NamgungJongMin Jan 24, 2025
ed323a7
refactor: 채팅 관련 타입 변경으로 인한 수정
who0803 Jan 24, 2025
1687fed
fix: 변경된 여행 타입 반영
NewJiSoo Jan 24, 2025
97a1396
refactor: Auth 관련 타입 재설정 및 api 적용
NamgungJongMin Jan 24, 2025
9c428cb
refactor: 유저 관련 타입 재설정 및 api 적용
NamgungJongMin Jan 24, 2025
a3479dd
refactor: EditForm 컴포넌트 타입 수정
NamgungJongMin Jan 24, 2025
442a039
refactor: Auth 관련 타입 및 api 수정 관련 리팩토링
NamgungJongMin Jan 24, 2025
7223486
refactor: preview 페이지 삭제
who0803 Jan 24, 2025
1594c09
refactor: 유저 타입 변경 사이드 이펙트 해결
NamgungJongMin Jan 24, 2025
966c0fc
fix: 유저 타입 수정, 여행 데이터 옵셔널 추가
NewJiSoo Jan 27, 2025
afb983c
Merge pull request #209 from Team-Talking-Potatoes/refactor/type-travel
NamgungJongMin Jan 27, 2025
6a6da4f
refactor: 프롭스 부분 타입 단언 조건부로 수정
who0803 Jan 27, 2025
16d8c76
Merge pull request #211 from Team-Talking-Potatoes/refactor/api-auth
NamgungJongMin Jan 27, 2025
5467c98
Merge branch 'dev' into refactor/api-user
NamgungJongMin Jan 27, 2025
e2b65d4
Merge pull request #212 from Team-Talking-Potatoes/refactor/api-user
NamgungJongMin Jan 27, 2025
5c56b4f
Merge pull request #210 from Team-Talking-Potatoes/refactor/type-chat
NamgungJongMin Jan 27, 2025
0859498
refactor: ChatRoom 컴포넌트 타입 에러 수정
who0803 Jan 27, 2025
2c91fd9
fix: user 타입 수정, 헤더 타입 수정, 테스트 코드 더미 파일 수정
NewJiSoo Jan 27, 2025
f4f0418
Merge pull request #213 from Team-Talking-Potatoes/refactor/type-chat
NamgungJongMin Jan 27, 2025
fc804a8
Merge pull request #214 from Team-Talking-Potatoes/refactor/type-travel
NamgungJongMin Jan 27, 2025
c15cb5a
fix: ListResponse 타입 api 반환에 맞게 수정
NamgungJongMin Feb 5, 2025
fd26f4c
refactor: 리뷰 관련 타입 수정
NamgungJongMin Feb 5, 2025
6bc5c26
refactor: 리뷰 관련 api 로직 수정
NamgungJongMin Feb 5, 2025
eec01b6
refactor: 리뷰 관련 타입 수정 적용
NamgungJongMin Feb 5, 2025
21f0cda
refactor: 타입 수정으로 인한 테스트 오류 해결
NamgungJongMin Feb 5, 2025
8b5a62b
fix: 리뷰 리스트 api 이슈 해결
NamgungJongMin Feb 5, 2025
efd2abc
refactor: api 상태 코드 변경 적용
NamgungJongMin Feb 5, 2025
104db09
refactor: api 수정 및 태그, aria-label 수정
NewJiSoo Feb 5, 2025
64454ac
refactor: 태그 수정
NewJiSoo Feb 5, 2025
179c3f5
feat: 채팅 에러 핸들링 훅 생성
who0803 Feb 6, 2025
95e29d6
refactor: 채팅 요청 에러핸들링 훅 적용
who0803 Feb 6, 2025
f6f34ec
refactor: 여행 만들기 api 에러 코드 수정
who0803 Feb 6, 2025
636ee25
refactor: 리뷰 상세 반환값 네이밍 변경 적용
NamgungJongMin Feb 6, 2025
bf34e07
refactor: 여행 상세 내 리뷰 api 엔드포인트 변경
NamgungJongMin Feb 6, 2025
d142f3e
refactor: 여행 상세 리뷰 무한스크롤 페이지 수정
NamgungJongMin Feb 6, 2025
c12fc89
refactor: 접근성 관련 리스트 스킵 컴포넌트 작성
NamgungJongMin Feb 6, 2025
5b49154
refactor: 시멘틱 구조 변경 & 리스트 스킵 적용
NamgungJongMin Feb 6, 2025
3769889
Merge pull request #215 from Team-Talking-Potatoes/refactor/api-review
NamgungJongMin Feb 6, 2025
9b1b555
Merge branch 'dev' into refactor/216-travel-list
NamgungJongMin Feb 6, 2025
6acc4db
Merge pull request #217 from Team-Talking-Potatoes/refactor/216-trave…
NamgungJongMin Feb 6, 2025
ad23ccb
Merge pull request #218 from Team-Talking-Potatoes/refactor/api-chat
NamgungJongMin Feb 6, 2025
967523e
Merge pull request #219 from Team-Talking-Potatoes/refactor/a11y
NamgungJongMin Feb 6, 2025
91380c3
refactor: 여행 리스트 탈출 버튼 적용, 이미지 onload 수정, 테스트 코드 에러사항 수정 반영
NewJiSoo Feb 6, 2025
b1921dd
refactor: 조건부 렌더링 해제
NamgungJongMin Feb 6, 2025
c613773
Merge pull request #220 from Team-Talking-Potatoes/test/202-travel
NamgungJongMin Feb 6, 2025
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
16 changes: 13 additions & 3 deletions src/@types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,21 @@ export interface APIError extends Error {
message: string;
}

export interface ApiResponse<T> {
export interface FetcherError extends Error {
status?: number;
}

export interface BaseResponse<T> {
status: string;
data: T;
}

export interface FetcherError extends Error {
status?: number;
export interface ListResponse<T> {
status: string;
data: {
content: T[];
total: number;
currentPage: number;
hasNext: boolean;
};
}
11 changes: 3 additions & 8 deletions src/@types/auth.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
interface TextInput {
export interface AuthInput {
email: string;
verifyNumber: number;
name: string;
nickname: string;
birthDate: number;
contact: string;
}

interface PasswordInput {
currentPassword: string;
password: string;
newPassword: string;
passwordConfirm: string;
}

interface ValidateOptions {
name: keyof TextInput | keyof PasswordInput;
export interface ValidateOptions {
name: keyof AuthInput;
value: string;
password?: string;
}

export type { TextInput, PasswordInput, ValidateOptions };
33 changes: 16 additions & 17 deletions src/@types/chat.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
import { CHAT_SORT_OPTIONS } from '@/constants/chat';
import { User } from './user';

export type SortType = keyof typeof CHAT_SORT_OPTIONS;

export interface RoomResponse {
export interface ChatRoom {
chatId: string;
chattingName: string;
description: string;
host: string;
hostProfileImage: string;
hasJoined: boolean;
unreadMessageCount: number;
lastMessageTime: string;
image: string;
unreadMessageCount: number;
membersCount: number;
totalMembersCount: number;
hostProfileImage: string;
description: string;
}

export interface ChattingResponse {
export interface Chat {
chatTitle: string;
chatMessages: ChatMessage[];
}

export interface ChatOverview {
participants: Participant[];
album: ImageInfo[];
}

export interface ChatMessage {
chatMessageId: string;
images: string[];
Expand All @@ -31,20 +35,15 @@ export interface ChatMessage {
unreadCount: number;
}

export interface ChatOverview {
participants: Participant[];
album: ImageInfo[];
}

export interface ImageInfo {
images: string[];
uploadDate: string;
uploader: string;
}
export interface Participant {
user: string;
email: string;
description: string;
profileImage: string;

export interface Participant
extends Pick<User, 'email' | 'profileImage' | 'nickname' | 'description'> {
travelCount: number;
}

export type SortType = keyof typeof CHAT_SORT_OPTIONS;
69 changes: 26 additions & 43 deletions src/@types/review.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,41 @@
export interface Review {
// 리뷰 정보
reviewId: number;
id: number;
title: string;
nickname?: string;
profileImage?: string;
imageUrl: string;
reviewImage: string;
title: string;
content: string;
score?: number;
reviewImages: string[];
starRating: number;
travelLocation: string;
likesCount: number;
likesFlag: boolean;
createdAt: string;
isLast: boolean;
likesFlag?: boolean;
}

export interface ReviewResponse {
content: Review[];
currentPage: number;
size: number;
total: number;
hasNext: boolean;
}

export interface Filters {
sortOrder: 'createdAt' | 'popular';
}
export interface ReviewListFilters {
sortOrder: 'LATEST' | 'POPULAR';
}
travelLocation: string;

export interface ReviewDetail {
reviewId: number;
// 여행 정보
travelId: number;
travelTitle: string;
userProfileImage: string;

// 유저 정보
nickname: string;
title: string;
comment: string;
starRating: number;
reviewImages: string[];
likesCount: number;
likesFlag: boolean;
travelLocation: string;
createdAt: string;
profileImage: string;
}

export interface ReviewDetailResponse {
status: string;
data: ReviewDetail;
export interface ReviewRatings {
totalReviews: number;
oneStarReviews: number;
twoStarReviews: number;
threeStarReviews: number;
fourStarReviews: number;
fiveStarReviews: number;
}

export interface CreateReview {
score: number;
content: string;
reviewImage: File[];
export interface ReviewScore {
totalRating: number;
reviewRatings: ReviewRatings;
}

export interface ReviewListFilters {
sortOrder: 'LATEST' | 'POPULAR';
pageParam: number;
size: number;
}
73 changes: 33 additions & 40 deletions src/@types/travel.ts
Original file line number Diff line number Diff line change
@@ -1,47 +1,18 @@
export interface Travel {
travelId: number;
travelName: string;
isDomestic: boolean;
travelStatus?: string;
location: string;
image: string;
startAt: string;
endAt: string;
maxTravelMateCount: number;
currentTravelMateCount: number;
formattedStartDate?: string;
expectedTripCost?: number;
isBookmark: boolean | null;
}
import { User } from './user';

export interface TravelPlan {
tripDay: number;
tripOrderNumber: number;
destination: string;
description: string;
image: string;
}

export interface Participant {
id: number;
nickname: string;
role: string;
profileImage: string;
}

export interface TravelDetail {
export interface Travel {
travelId: number;
travelName: string;
description: string;
image: string;
expectedTripCost: number;
travelImage: string;
expectedTripCost?: number;
currentTravelMateCount: number;
minTravelMateCount: number;
maxTravelMateCount: number;
hashTags: string;
isDomestic: boolean;
travelLocation: string;
departureLocation: string;
departureLocation?: string;
startAt: string;
endAt: string;
registrationEnd: string;
Expand All @@ -52,6 +23,33 @@ export interface TravelDetail {
bookmarkFlag: boolean | null;
}

export interface TravelPlan {
tripDay: number;
tripOrderNumber: number;
destination: string;
description: string;
travelPlanImage: string;
}

export type TravelCard = Pick<
Travel,
| 'travelId'
| 'travelImage'
| 'isDomestic'
| 'travelName'
| 'travelLocation'
| 'maxTravelMateCount'
| 'currentTravelMateCount'
| 'startAt'
| 'endAt'
| 'bookmarkFlag'
>;

export interface Participant
extends Pick<User, 'userId' | 'profileImage' | 'nickname'> {
role: string;
}

export interface TravelReviewRateScore {
oneStarReviews: number;
twoStarReviews: number;
Expand Down Expand Up @@ -82,11 +80,6 @@ export interface TravelParams {
filters?: Filters;
}

export interface TravelFilterResponse {
content: Travel[];
currentPage: number;
hasNext: boolean;
}
export interface TravelList {
travelId: number;
travelName: string;
Expand All @@ -103,7 +96,7 @@ export interface TravelList {
}

export interface MyTravel {
content: TravelList[];
content: Travel[];
total: number;
currentPage: number;
hasNext: boolean;
Expand Down
27 changes: 1 addition & 26 deletions src/@types/user.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
export interface User {
id: number;
email: string;
password: string;
name: string;
nickname: string;
contact: string;
birthDate: number;
image: string;
createdAt: string;
updatedAt: string;
SaveList: [];
LikesList: [];
ParticipationList: [];
}

export interface UserList {
userId: number;
profileImage: string;
nickName: string;
openTravelCount: number;
reviewCount: number;
hashTags: string;
}

export interface MyPageProfile {
userId: number;
email: string;
nickname: string;
image: string;
profileImage: string;
description: string;
}
14 changes: 11 additions & 3 deletions src/api/auth/deleteAccount.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import { AuthInput } from '@/@types/auth';
import { BaseResponse } from '@/@types/api';
import { http } from '../fetcher';

export const checkPassword = (password: { password: string }) => {
return http.post<any>('/users/check/password', password);
type PasswordRequestBody = Pick<AuthInput, 'password'>;

interface CheckPasswordToken {
deleteUserToken: string;
}

export const checkPassword = (password: PasswordRequestBody) => {
return http.post<BaseResponse<object>>('/users/check/password', password);
};

export const deleteAccount = () => {
return http.delete<any>('/users');
return http.delete<BaseResponse<CheckPasswordToken>>('/users');
};
7 changes: 4 additions & 3 deletions src/api/auth/login.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { User } from '@/@types/user';
import { AuthInput } from '@/@types/auth';
import { BaseResponse } from '@/@types/api';
import { http } from '../fetcher';

type LoginRequestBody = Pick<User, 'email' | 'password'>;
type LoginRequestBody = Pick<AuthInput, 'email' | 'password'>;

export const login = (credentials: LoginRequestBody) => {
return http.post<any>('/auth/sign-in', credentials);
return http.post<BaseResponse<object>>('/auth/sign-in', credentials);
};
3 changes: 2 additions & 1 deletion src/api/auth/logout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BaseResponse } from '@/@types/api';
import { http } from '../fetcher';

export const logout = () => {
return http.post<any>('/auth/sign-out');
return http.post<BaseResponse<object>>('/auth/sign-out');
};
Loading