Skip to content

Commit 5593aef

Browse files
committed
fix: added InfiniteData wrapper for useInfinite hook
1 parent 211ab8b commit 5593aef

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

commons-rest-openapi/src/main/resources/templates/hook/hook-template.pebble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ export const {{ method.queryOptionName -}} = <TData={{ method.shortReturnType }}
9595
{{ infiniteOptions( method ) }}
9696
});
9797

98-
export function {{ method.hookName -}}<TData = {{ method.shortReturnType }}, {% block "terror" %}TError = {% if reactQueryVersion.name equals "v5" %}Error{% else %}unknown{% endif %}{% endblock %}>({% if method.hasRequiredFields or method.hasOptionalFields %}filter: {{ method.shortInputType }},{% endif %} options: Omit<UseInfiniteQueryOptions<{{ method.shortReturnType }}, TError, TData>, "queryFn" | "queryKey" | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> = {}) {
98+
export function {{ method.hookName -}}<TData = InfiniteData<{{ method.shortReturnType }}>, {% block "terror" %}TError = {% if reactQueryVersion.name equals "v5" %}Error{% else %}unknown{% endif %}{% endblock %}>({% if method.hasRequiredFields or method.hasOptionalFields %}filter: {{ method.shortInputType }},{% endif %} options: Omit<UseInfiniteQueryOptions<{{ method.shortReturnType }}, TError, TData>, "queryFn" | "queryKey" | "getPreviousPageParam" | "getNextPageParam" | "initialPageParam"> = {}) {
9999
const { {{ configuredGroupVar }} } = useApi();
100100
return useInfiniteQuery<{{ method.shortReturnType }}, TError, TData>({{ method.queryOptionName -}}({{ configuredGroupVar }}, {% if method.hasRequiredFields or method.hasOptionalFields %}filter,{% endif %} options));
101101
}

0 commit comments

Comments
 (0)