mirror of
https://github.com/khairul169/garage-webui.git
synced 2026-09-18 10:23:21 +07:00
feat: add bucket object browser
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
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 }),
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user