1+ import { ApiResponse } from '../../../shared/types/api/apiResponse' ;
2+ import { useParams , useNavigate } from 'react-router-dom' ;
3+ import { useQuery , useMutation , useQueryClient } from '@tanstack/react-query' ;
4+ import { TicketOptionRequest , TicketOptionTypeResponse } from '../model/ticketOption' ;
15import {
26 PersonalTicketOptionAnswerResponse ,
37 TicketOptionAnswerRequest ,
@@ -10,7 +14,17 @@ import {
1014 readPurchaserAnswers ,
1115 readTicketOptions ,
1216} from '../api/ticketOption' ;
13- import { ApiResponse } from '../../../shared/types/api/apiResponse' ;
17+ import {
18+ getTicketOptions ,
19+ createTicketOption ,
20+ modifyTicketOption ,
21+ deleteTicketOption ,
22+ getAttachedTicketOptions ,
23+ getTicketOptionDetail ,
24+ attachTicketOption ,
25+ detachTicketOption ,
26+ } from '../api/ticketOption' ;
27+
1428
1529// 티켓 옵션 조회
1630export const useTicketOptions = ( ticketId : number ) => {
@@ -62,21 +76,7 @@ export const usePersonalTicketOptionAnswers = (ticketId: number | null) => {
6276 } ) ;
6377} ;
6478
65- import { useParams , useNavigate } from 'react-router-dom' ;
66- import { useQuery , useMutation , useQueryClient } from '@tanstack/react-query' ;
67- import {
68- getTicketOptions ,
69- createTicketOption ,
70- modifyTicketOption ,
71- deleteTicketOption ,
72- getAttachedTicketOptions ,
73- getTicketOptionDetail ,
74- attachTicketOption ,
75- detachTicketOption ,
76- } from '../api/ticketOption' ;
77- import { TicketOptionRequest , TicketOptionResponse } from '../model/ticketOption' ;
78-
79- // 티켓 옵션 생성 훅
79+ // 티켓 옵션 생성 훅
8080export const useCreateTicketOptionMutation = ( ) => {
8181 const { id } = useParams ( ) ;
8282 const navigate = useNavigate ( ) ;
@@ -138,7 +138,7 @@ export const useGetTicketOptions = () => {
138138 const { id } = useParams ( ) ;
139139 const eventId = Number ( id ) ;
140140
141- return useQuery < TicketOptionResponse > ( {
141+ return useQuery < TicketOptionTypeResponse > ( {
142142 queryKey : [ 'ticketOptions' , id ] ,
143143 queryFn : ( ) => getTicketOptions ( eventId ) ,
144144 enabled : ! ! id ,
@@ -147,7 +147,7 @@ export const useGetTicketOptions = () => {
147147
148148// 티켓에 부착된 옵션 목록 조회 훅
149149export const useGetAttachedTicketOptions = ( ticketId : number ) => {
150- return useQuery < TicketOptionResponse > ( {
150+ return useQuery < TicketOptionTypeResponse > ( {
151151 queryKey : [ 'attachedTicketOptions' , ticketId ] ,
152152 queryFn : ( ) => getAttachedTicketOptions ( ticketId ) ,
153153 enabled : ! ! ticketId ,
@@ -156,7 +156,7 @@ export const useGetAttachedTicketOptions = (ticketId: number) => {
156156
157157// 티켓 옵션 상세 조회 훅
158158export const useGetTicketOptionDetail = ( ticketOptionId : number ) => {
159- return useQuery < TicketOptionResponse > ( {
159+ return useQuery < TicketOptionTypeResponse > ( {
160160 queryKey : [ 'ticketOptionDetail' , ticketOptionId ] ,
161161 queryFn : ( ) => getTicketOptionDetail ( ticketOptionId ) ,
162162 enabled : ! ! ticketOptionId ,
0 commit comments