File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/components/GnomeLibrary/utils/hooks Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,9 @@ import type {
77import { keepPreviousData , useQuery } from "@tanstack/react-query" ;
88import ChrisAPIClient from "../../../../api/chrisapiclient" ;
99
10+ // Initialize client at module level
11+ const client = ChrisAPIClient . getClient ( ) ;
12+
1013// Define the interface for pagination
1114interface PaginationInfo {
1215 totalCount : number ;
@@ -31,13 +34,15 @@ export interface FolderHookData extends FolderTableData {
3134 errorMessages ?: string [ ] ;
3235}
3336
37+ /**
38+ * Fetches folder data from the API
39+ */
3440export async function fetchFolders (
3541 computedPath : string ,
3642 pageNumber = 1 ,
3743 previousData ?: FolderHookData ,
3844) : Promise < FolderHookData > {
39- const client = ChrisAPIClient . getClient ( ) ;
40-
45+ // Use the already initialized client
4146 const itemsPerPage = 50 ;
4247 const errorMessages : string [ ] = [ ] ;
4348
You can’t perform that action at this time.
0 commit comments