File tree 4 files changed +11
-9
lines changed
apps/admin/src/pages/HomePage
4 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ const HomePage = () => {
44
44
const { data : userProfileData , isLoading : isUserProfileLoading } = useUserProfile ( ) ;
45
45
const { data : showList = [ ] , isLoading : isShowListLoading } = useShowList ( ) ;
46
46
const { data : settlementBanners } = useSettlementBanners ( ) ;
47
- const { data : popupData } = usePopup ( ) ;
47
+ const { data : popupData } = usePopup ( 'HOME' ) ;
48
48
usePopupDialog ( popupData ) ;
49
49
50
50
const { imgPath, nickname = '' , userCode } = userProfileData ?? { } ;
Original file line number Diff line number Diff line change 1
1
import { useQuery } from '@tanstack/react-query' ;
2
2
3
3
import { queryKeys } from '../queryKey' ;
4
+ import { PopupViewType } from '../types' ;
4
5
5
- const usePopup = ( ) => useQuery ( queryKeys . popup . info ) ;
6
+ const usePopup = ( view : PopupViewType ) => useQuery ( queryKeys . popup . info ( view ) ) ;
6
7
7
8
export default usePopup ;
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
25
25
TicketStatus ,
26
26
TicketType ,
27
27
Popup ,
28
+ PopupViewType ,
28
29
} from './types' ;
29
30
import {
30
31
AdminShowDetailResponse ,
@@ -134,8 +135,7 @@ export const adminShowQueryKeys = createQueryKeys('adminShow', {
134
135
} ) ,
135
136
settlementStatement : ( showId : number ) => ( {
136
137
queryKey : [ showId ] ,
137
- queryFn : ( ) =>
138
- instance . get ( `sa-api/v1/shows/${ showId } /settlement-statements/last/file` ) . blob ( ) ,
138
+ queryFn : ( ) => instance . get ( `sa-api/v1/shows/${ showId } /settlement-statements/last/file` ) . blob ( ) ,
139
139
} ) ,
140
140
ticketSalesInfo : ( showId : number ) => ( {
141
141
queryKey : [ showId ] ,
@@ -453,10 +453,10 @@ export const castTeamQueryKeys = createQueryKeys('castTeams', {
453
453
} ) ;
454
454
455
455
export const popupQueryKeys = createQueryKeys ( 'popup' , {
456
- info : {
457
- queryKey : null ,
458
- queryFn : ( ) => fetcher . get < Popup > ( ' web/papi/v1/popup' ) ,
459
- } ,
456
+ info : ( view : PopupViewType ) => ( {
457
+ queryKey : [ view ] ,
458
+ queryFn : ( ) => fetcher . get < Popup > ( ` web/papi/v1/popup/ ${ view } ` ) ,
459
+ } ) ,
460
460
} ) ;
461
461
462
462
export const queryKeys = mergeQueryKeys (
Original file line number Diff line number Diff line change @@ -2,9 +2,10 @@ export interface Popup {
2
2
id : number ;
3
3
type : 'EVENT' | 'NOTICE' ;
4
4
eventUrl : string | null ;
5
- view : 'Home' ;
6
5
noticeTitle : string | null ;
7
6
description : string ;
8
7
startDate : string ;
9
8
endDate : string ;
10
9
}
10
+
11
+ export type PopupViewType = 'HOME' | 'SHOW' ;
You can’t perform that action at this time.
0 commit comments