react-query-lightbase-codegen 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -904,8 +904,8 @@ const generateRestfulComponent = ({ operation, verb, route, operationIds, parame
|
|
|
904
904
|
type ${componentName}QueryProps<T = ${componentName}Return> = ${componentName}Variables & {
|
|
905
905
|
options?: UseQueryOptions<${componentName}Return, AxiosError, T, any>
|
|
906
906
|
}
|
|
907
|
-
export function use${componentName}Query<T = ${componentName}Return>({ options = {}, ...
|
|
908
|
-
return useQuery(use${componentName}Query.queryKey(
|
|
907
|
+
export function use${componentName}Query<T = ${componentName}Return>({ options = {}, ...props }: ${componentName}QueryProps<T>) {
|
|
908
|
+
return useQuery(use${componentName}Query.queryKey(props), async () => use${componentName}Query.fetch(props),
|
|
909
909
|
{ enabled: ${enabledParam}, ...options }
|
|
910
910
|
);}
|
|
911
911
|
|
|
@@ -884,8 +884,8 @@ export const generateRestfulComponent = ({ operation, verb, route, operationIds,
|
|
|
884
884
|
type ${componentName}QueryProps<T = ${componentName}Return> = ${componentName}Variables & {
|
|
885
885
|
options?: UseQueryOptions<${componentName}Return, AxiosError, T, any>
|
|
886
886
|
}
|
|
887
|
-
export function use${componentName}Query<T = ${componentName}Return>({ options = {}, ...
|
|
888
|
-
return useQuery(use${componentName}Query.queryKey(
|
|
887
|
+
export function use${componentName}Query<T = ${componentName}Return>({ options = {}, ...props }: ${componentName}QueryProps<T>) {
|
|
888
|
+
return useQuery(use${componentName}Query.queryKey(props), async () => use${componentName}Query.fetch(props),
|
|
889
889
|
{ enabled: ${enabledParam}, ...options }
|
|
890
890
|
);}
|
|
891
891
|
|