Skip to content

Commit 38f9bac

Browse files
committed
fix: qa 해결
1 parent d360ddc commit 38f9bac

9 files changed

Lines changed: 50 additions & 24 deletions

File tree

  • apps
    • ticket-admin/src
    • ticket/src
      • app/(pages)
        • entry/[ticketCode]/_clientBounday/EntryClient
        • event/[eventId]/_clientBoundray/DesktopTicketSectionClient
      • lib/axios

apps/ticket-admin/src/app/events/[eventId]/edit/_clientBoundary/EventEditFormClient/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ export function EventEditFormClient({ eventId }: Props) {
697697
</Typography>
698698
<Typography type="body16" color="gray200">
699699
{eventDetailData.startDate}~{eventDetailData.endDate} / {eventDetailData.startTime}~
700-
{eventDetailData.endTime}/{eventDetailData.venue}
700+
{eventDetailData.endTime} / {eventDetailData.venue}
701701
</Typography>
702702
</div>
703703
<div className={cx("container")}>

apps/ticket-admin/src/app/events/[eventId]/edit/timeTable/_clientBoundary/TimeTableManagementClient/index.tsx

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
"use client";
22

3+
import Link from "next/link";
34
import classNames from "classnames/bind";
45

56
import { Button, Flex, Select, TextField, Typography } from "@permit/design-system";
67
import { useSelect, useTextField } from "@permit/design-system/hooks";
78
import { useTimeTableSuspenseQuery } from "@/data/admin/getTimeTables/queries";
89
import { useTimeTableMutation } from "@/data/admin/patchTimeTables/mutation";
910
import { usePostTimeTableInitial } from "@/data/admin/postTimeTable/mutation";
11+
import { EXTERNAL_PATH } from "@/shared/constants/path";
12+
import { getPathUrl } from "@/shared/helpers/getPathUrl";
1013

1114
import styles from "./index.module.scss";
1215

@@ -24,8 +27,6 @@ export const TimeTableManagementClient = ({ eventId }: Props) => {
2427
},
2528
});
2629

27-
console.log("@@timeTableData", timeTableData);
28-
2930
const { mutateAsync: createTimeTable, isPending } = usePostTimeTableInitial({
3031
eventId,
3132
});
@@ -147,6 +148,13 @@ export const TimeTableManagementClient = ({ eventId }: Props) => {
147148
<div className={cx("container")}>
148149
<Typography type="title24">TimeTable</Typography>
149150
{/* TODO: 최초 등록에만 사용해주세요. */}
151+
{timeTableData?.eventId && (
152+
<Link href={getPathUrl(EXTERNAL_PATH.TIMETABLE, { eventId: timeTableData.eventId })}>
153+
<Typography type="body16" weight="bold" style={{ marginTop: "12px", color: "#5640ff" }}>
154+
TimeTable 로 이동하기
155+
</Typography>
156+
</Link>
157+
)}
150158

151159
<Flex direction="column" gap={24} style={{ marginTop: 32 }}>
152160
<Flex gap={24}>
@@ -162,28 +170,29 @@ export const TimeTableManagementClient = ({ eventId }: Props) => {
162170
</Flex>
163171
<Flex className={cx("row")} direction="column" gap={12}>
164172
<Typography type="body16" weight="bold">
165-
TimeTable End Date
173+
Start Time
166174
</Typography>
167-
<Select
168-
type="calendar"
169-
placeholder="타임테이블 종료 날짜를 선택해주세요"
170-
{...timeTableEndDateField.selectProps}
175+
<TextField
176+
placeholder="타임테이블 시작 시간을 입력해주세요 (HH:MM)"
177+
value={timeTableStartTimeField.value}
178+
onChange={timeTableStartTimeField.handleChange}
179+
error={timeTableStartTimeField.error}
171180
/>
172181
</Flex>
173182
</Flex>
174183

175184
<Flex gap={24}>
176185
<Flex className={cx("row")} direction="column" gap={12}>
177186
<Typography type="body16" weight="bold">
178-
Start Time
187+
TimeTable End Date
179188
</Typography>
180-
<TextField
181-
placeholder="타임테이블 시작 시간을 입력해주세요 (HH:MM)"
182-
value={timeTableStartTimeField.value}
183-
onChange={timeTableStartTimeField.handleChange}
184-
error={timeTableStartTimeField.error}
189+
<Select
190+
type="calendar"
191+
placeholder="타임테이블 종료 날짜를 선택해주세요"
192+
{...timeTableEndDateField.selectProps}
185193
/>
186194
</Flex>
195+
187196
<Flex className={cx("row")} direction="column" gap={12}>
188197
<Typography type="body16" weight="bold">
189198
End Time

apps/ticket-admin/src/data/admin/getTimeTables/queries.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ import { TimeTableParams, TimeTableResponse } from "./types";
1717
/** 행사 타임테이블 조회 API */
1818
export const timeTableOptions = (
1919
params: TimeTableParams,
20-
): PermitQueryOptions<TimeTableResponse> => {
20+
): PermitQueryOptions<TimeTableResponse | null> => {
2121
return {
2222
queryKey: [ADMIN_QUERY_KEYS.TICEKTS, params.eventId],
2323
queryFn: () => {
2424
const url = getPathUrl(API_URL.ADMIN.TIME_TABLE, { eventId: params.eventId });
2525

26-
return instance.get<TimeTableResponse>(url).then((res) => {
27-
return res?.data || null;
28-
});
26+
return instance
27+
.get<TimeTableResponse>(url)
28+
.then((res) => res.data)
29+
.catch(() => null);
2930
},
3031
};
3132
};
@@ -34,7 +35,7 @@ export const timeTableOptions = (
3435
export const useTimeTableQuery = ({
3536
eventId,
3637
options,
37-
}: TimeTableParams & OptionsObject<UsePermitQueryOptions<TimeTableResponse>>) => {
38+
}: TimeTableParams & OptionsObject<UsePermitQueryOptions<TimeTableResponse | null>>) => {
3839
return useQuery({
3940
...timeTableOptions({ eventId }),
4041
...options,
@@ -45,7 +46,7 @@ export const useTimeTableQuery = ({
4546
export const useTimeTableSuspenseQuery = ({
4647
eventId,
4748
options,
48-
}: TimeTableParams & OptionsObject<UsePermitSuspenseQueryOptions<TimeTableResponse>>) => {
49+
}: TimeTableParams & OptionsObject<UsePermitSuspenseQueryOptions<TimeTableResponse | null>>) => {
4950
return useSuspenseQuery({
5051
...timeTableOptions({ eventId }),
5152
...options,

apps/ticket-admin/src/data/admin/getTimeTables/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export type TimeTableParams = {
33
};
44

55
export type TimeTableResponse = {
6+
eventId: string;
67
timetableId: number;
78
timetableStartDate: string;
89
timetableStartTime: string;

apps/ticket-admin/src/lib/axios/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ instance.interceptors.response.use(
115115
}
116116
}
117117

118-
return Promise.reject(error.response?.data);
118+
return Promise.reject(error?.response?.data);
119119
},
120120
);

apps/ticket-admin/src/shared/constants/path.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ const phase =
88
export const EXTERNAL_PATH = {
99
HOME: `https://${phase}.permitseoul.com`,
1010
LOGIN: `https://${phase}.permitseoul.com/login`,
11+
TIMETABLE: `https://${phase}.permitseoul.com/event/:eventId/time-table`,
1112
} as const;

apps/ticket/src/app/(pages)/entry/[ticketCode]/_clientBounday/EntryClient/index.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const cx = classNames.bind(styles);
1818

1919
const NO_ENTRY_TIME = 40013;
2020
const ALREADY_USED_TICKET = 40906;
21+
const CANCELED_TICKET = 40015;
2122

2223
type Props = {
2324
ticketCode: string;
@@ -89,6 +90,19 @@ export const EntryClient = ({ ticketCode }: Props) => {
8990
);
9091
}
9192

93+
if (error?.code === CANCELED_TICKET) {
94+
return (
95+
<Flex direction="column" justify="center" align="center" style={{ height: "100vh" }}>
96+
<Link className={cx("logo")} href="/">
97+
<Image src={permitLogo} alt="PERMIT" className={cx("logo_image")} />
98+
</Link>
99+
<Typography type="title20" weight="bold" color="white">
100+
취소된 티켓입니다.
101+
</Typography>
102+
</Flex>
103+
);
104+
}
105+
92106
if (error) {
93107
throw error;
94108
}

apps/ticket/src/app/(pages)/event/[eventId]/_clientBoundray/DesktopTicketSectionClient/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export const DesktopTicketSectionClient = ({ eventId, eventName }: Props) => {
3636

3737
const [isLoading, setIsLoading] = useState(false);
3838
const selectedRound = eventTicketsData.rounds.find((round) => round.roundAvailable);
39-
const [selectedRoundId, setSelectedRoundId] = useState<number>(
40-
selectedRound?.roundId || eventTicketsData.rounds[0].roundId,
39+
const [selectedRoundId, setSelectedRoundId] = useState<number | undefined>(
40+
selectedRound?.roundId,
4141
);
4242
const [selectedTickets, setSelectedTickets] = useState<SelectedTicket[]>([]);
4343
const [isPromocodeOpen, setIsPromocodeOpen] = useState(false);

apps/ticket/src/lib/axios/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ instance.interceptors.response.use(
120120
}
121121
}
122122

123-
return Promise.reject(error.response?.data);
123+
return Promise.reject(error?.response?.data);
124124
},
125125
);
126126

0 commit comments

Comments
 (0)