20 lines
406 B
TypeScript
Raw Normal View History

2024-08-16 01:23:55 +07:00
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);
});