Skip to content

Commit 3f18628

Browse files
authored
Merge pull request #197 from DevKor-github/fix/#193/pick-api
PICK api λŒ€μ‘
2 parents 2e9601e + 8b09066 commit 3f18628

4 files changed

Lines changed: 27 additions & 22 deletions

File tree

β€Žsrc/features/pickList/apis/useGetAppointment.tsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export interface GetAppointmentReuest {
1212
cursorDate?: string | null;
1313
}
1414

15-
export interface GetAppointmentResponst {
15+
export interface GetAppointmentResponse {
1616
message: string;
1717
data: {
1818
appointmentInfoList: AppointmentInterface[];
@@ -32,7 +32,7 @@ interface PageParam {
3232
}
3333

3434
const getAppointment = async (params: GetAppointmentReuest) => {
35-
const res = await client.get<GetAppointmentResponst>('/api/v1/appointment', {
35+
const res = await client.get<GetAppointmentResponse>('/api/v1/appointment', {
3636
params,
3737
});
3838

β€Žsrc/features/pickList/components/Btn/index.tsxβ€Ž

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ interface BtnProps {
77
nickname?: string;
88
chatRoomId?: number;
99
appointmentId: number;
10-
isComplete?: boolean;
10+
isReviewed?: boolean;
1111
}
1212

13-
const Btn = ({ type, isComplete, chatRoomId, appointmentId, nickname }: BtnProps) => {
14-
const title = type === 'chat' ? 'μ±„νŒ…μ°½' : isComplete ? 'μž‘μ„±μ™„λ£Œ' : 'λ¦¬λ·°μž‘μ„±';
15-
const iconColor = type === 'chat' ? '54' : isComplete ? 'systemGray2' : '100';
16-
const icon = type === 'chat' ? 'mgc_chat_1_fill' : isComplete ? 'mgc_choice_fill' : 'mgc_message_4_fill';
13+
const Btn = ({ type, isReviewed, chatRoomId, appointmentId, nickname }: BtnProps) => {
14+
const title = type === 'chat' ? 'μ±„νŒ…μ°½' : isReviewed ? 'μž‘μ„±μ™„λ£Œ' : 'λ¦¬λ·°μž‘μ„±';
15+
const iconColor = type === 'chat' ? '54' : isReviewed ? 'systemGray2' : '100';
16+
const icon = type === 'chat' ? 'mgc_chat_1_fill' : isReviewed ? 'mgc_choice_fill' : 'mgc_message_4_fill';
1717

18-
const bg = type === 'chat' ? 'systemGray2' : isComplete ? 'systemGray5' : 'main';
19-
const color = type === 'review' && isComplete ? '54' : '100';
18+
const bg = type === 'chat' ? 'systemGray2' : isReviewed ? 'systemGray5' : 'main';
19+
const color = type === 'review' && isReviewed ? '54' : '100';
2020

2121
const navigate = useNavigate();
2222

@@ -25,14 +25,13 @@ const Btn = ({ type, isComplete, chatRoomId, appointmentId, nickname }: BtnProps
2525
e.preventDefault();
2626

2727
if (type === 'chat') {
28-
alert('μ±„νŒ…μ°½μœΌλ‘œ μ—°κ²°');
2928
navigate(`/chatroom/${chatRoomId}`);
3029

3130
return;
3231
}
3332
if (type === 'review') {
3433
// 리뷰 μž‘μ„± 전일 λ•Œ,
35-
if (!isComplete) {
34+
if (!isReviewed) {
3635
alert('리뷰 μž‘μ„± νŽ˜μ΄μ§€λ‘œ μ—°κ²°');
3736
navigate(`/review/${appointmentId}`, {
3837
state: {

β€Žsrc/features/pickList/components/PickItemList/index.tsxβ€Ž

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ const PickItemList = ({ data }: PickItemListProps) => {
3737
showCount={3}
3838
itemInfo={{
3939
productTypes: data.productTypes,
40-
// transactionTypes: data.type,
41-
// quality: 'BEST',
42-
// size: 'L',
43-
// color: 'BLACK',
44-
// tradeMethods: ['DIRECT'],
40+
transactionTypes: [data.type],
41+
quality: data.quality,
42+
size: data.size,
43+
color: data.color,
44+
tradeMethods: ['DIRECT'],
4545
}}
4646
/>
4747
</div>
@@ -53,16 +53,16 @@ const PickItemList = ({ data }: PickItemListProps) => {
5353
<Btn
5454
type="chat"
5555
appointmentId={data.appointmentId}
56-
// nickname={data.nickname}
57-
// chatRoomId={data.chatRoomId}
56+
nickname={data.opponentNickname}
57+
chatRoomId={data.chatRoomId}
5858
/>
5959
{isSuccess && (
6060
<Btn
6161
type="review"
6262
appointmentId={data.appointmentId}
63-
// nickname={data.nickname}
64-
// isComplete={data.isComplete}
65-
// chatRoomId={data.chatRoomId}
63+
nickname={data.opponentNickname}
64+
isReviewed={data.isReviewed}
65+
chatRoomId={data.chatRoomId}
6666
/>
6767
)}
6868
</div>

β€Žsrc/features/pickList/types.tsβ€Ž

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
1-
import type { ProductType, TradeMethods, TransactionType } from '@/libs/types/item';
1+
import type { Color, ProductType, Quality, Size, TradeMethods, TransactionType } from '@/libs/types/item';
22

33
export interface AppointmentInterface {
44
appointmentId: number;
55
itemId: number;
6+
chatRoomId: number;
67
requesterId: number;
78
ownerId: number;
89
isCreator: boolean;
910
imageUrl: string;
1011
title: string;
1112
description: string;
1213
productTypes: ProductType[];
14+
quality: Quality;
15+
size: Size;
16+
color: Color;
1317
rentalDate: string;
1418
returnDate: string;
1519
rentalLocation: string;
@@ -19,4 +23,6 @@ export interface AppointmentInterface {
1923
state: 'CONFIRMED' | 'IN_PROGRESS' | 'SUCCESS';
2024
type: TransactionType;
2125
tradeMethod: TradeMethods;
26+
opponentNickname: string;
27+
isReviewed: boolean;
2228
}

0 commit comments

Comments
Β (0)