display folders and files into
This commit is contained in:
@@ -70,3 +70,12 @@ export function useFolders() {
|
||||
queryFn: () => apiClient.get<{ data: FileItem[] }>(ENDPOINTS.FOLDERS),
|
||||
});
|
||||
}
|
||||
|
||||
export function useFilesByParent(parentId: string) {
|
||||
return useQuery({
|
||||
queryKey: ['files', 'parent', parentId],
|
||||
queryFn: () =>
|
||||
apiClient.get<{ data: FileItem[] }>(`${ENDPOINTS.FOLDERS}/${parentId}/files`),
|
||||
enabled: !!parentId,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user