File tree Expand file tree Collapse file tree
src/features/remoteConfig/api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,22 +4,22 @@ import { RemoteConfig } from "../types";
44import { axios } from 'src/lib/axios' ;
55import { useRemoteConfigStore } from "../stores/remoteConfig" ;
66
7- const getAd = async ( ) : Promise < RemoteConfig > => {
7+ const getRemoteConfig = async ( ) : Promise < RemoteConfig > => {
88 return axios . get ( '/data/remoteConfiguration.json' ) ;
99}
1010
11- type QueryFnType = typeof getAd ;
11+ type QueryFnType = typeof getRemoteConfig ;
1212
13- type UseGetAdOptions = {
13+ type UseGetRemoteConfigOptions = {
1414 config ?: QueryConfig < QueryFnType > ;
1515} ;
16- export const useGetRemoteConfig = ( { config } : UseGetAdOptions = { } ) => {
16+ export const useGetRemoteConfig = ( { config } : UseGetRemoteConfigOptions = { } ) => {
1717 return useQuery < ExtractFnReturnType < QueryFnType > > ( {
1818 onSuccess ( remoteConfig ) {
1919 useRemoteConfigStore . getState ( ) . setRemoteConfig ( remoteConfig ) ;
2020 } ,
2121 ...config ,
2222 queryKey : [ 'remote-config' ] ,
23- queryFn : ( ) => getAd ( ) ,
23+ queryFn : ( ) => getRemoteConfig ( ) ,
2424 } ) ;
2525}
You can’t perform that action at this time.
0 commit comments