mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
refactor: frontend components consolidation
This commit is contained in:
@@ -29,14 +29,7 @@ export const volumeController = new Hono()
|
||||
.get("/", listVolumesDto, async (c) => {
|
||||
const volumes = await volumeService.listVolumes();
|
||||
|
||||
const response = {
|
||||
volumes: volumes.map((volume) => ({
|
||||
path: getVolumePath(volume.name),
|
||||
...volume,
|
||||
})),
|
||||
};
|
||||
|
||||
return c.json<ListVolumesDto>(response, 200);
|
||||
return c.json<ListVolumesDto>(volumes, 200);
|
||||
})
|
||||
.post("/", createVolumeDto, validator("json", createVolumeBody), async (c) => {
|
||||
const body = c.req.valid("json");
|
||||
|
||||
@@ -5,7 +5,6 @@ import { describeRoute, resolver } from "hono-openapi";
|
||||
export const volumeSchema = type({
|
||||
id: "number",
|
||||
name: "string",
|
||||
path: "string",
|
||||
type: type.valueOf(BACKEND_TYPES),
|
||||
status: type.valueOf(BACKEND_STATUS),
|
||||
lastError: "string | null",
|
||||
@@ -21,9 +20,7 @@ export type VolumeDto = typeof volumeSchema.infer;
|
||||
/**
|
||||
* List all volumes
|
||||
*/
|
||||
export const listVolumesResponse = type({
|
||||
volumes: volumeSchema.array(),
|
||||
});
|
||||
export const listVolumesResponse = volumeSchema.array();
|
||||
export type ListVolumesDto = typeof listVolumesResponse.infer;
|
||||
|
||||
export const listVolumesDto = describeRoute({
|
||||
|
||||
Reference in New Issue
Block a user