feat: add bucket object browser

This commit is contained in:
2024-08-18 22:57:08 +07:00
parent 3a147f4133
commit 934e0c409c
29 changed files with 656 additions and 18 deletions
+14
View File
@@ -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 }),
});
};