mirror of
https://github.com/khairul169/garage-webui.git
synced 2025-04-28 06:49:32 +07:00
15 lines
410 B
TypeScript
15 lines
410 B
TypeScript
import api from "@/lib/api";
|
|
import { useQuery } from "@tanstack/react-query";
|
|
import { GetObjectsResult, UseBrowserObjectOptions } from "./types";
|
|
|
|
export const useBrowseObjects = (
|
|
bucket: string,
|
|
options?: UseBrowserObjectOptions
|
|
) => {
|
|
return useQuery({
|
|
queryKey: ["browse", bucket, options],
|
|
queryFn: () =>
|
|
api.get<GetObjectsResult>(`/browse/${bucket}`, { params: options }),
|
|
});
|
|
};
|