mirror of
https://github.com/khairul169/garage-webui.git
synced 2025-04-28 14:59:31 +07:00
20 lines
406 B
TypeScript
20 lines
406 B
TypeScript
import { Hono } from "hono";
|
|
import api from "../lib/api";
|
|
|
|
export const buckets = new Hono()
|
|
|
|
/**
|
|
* Get all buckets
|
|
*/
|
|
.get("/", async (c) => {
|
|
const data = await api.get("/v1/bucket?list");
|
|
|
|
const buckets = await Promise.all(
|
|
data.map(async (bucket: any) => {
|
|
return api.get("/v1/bucket", { params: { id: bucket.id } });
|
|
})
|
|
);
|
|
|
|
return c.json(buckets);
|
|
});
|