feat(server): test mount endpoint

This commit is contained in:
Nicolas Meienberger
2025-09-02 22:52:44 +02:00
parent de0ae08008
commit 0c0a3b8581
9 changed files with 184 additions and 4 deletions

View File

@@ -7,6 +7,8 @@ import {
deleteVolumeDto,
type ListVolumesResponseDto,
listVolumesDto,
testConnectionBody,
testConnectionDto,
} from "./volume.dto";
import { volumeService } from "./volume.service";
@@ -35,6 +37,12 @@ export const volumeController = new Hono()
return c.json({ message: "Volume created", volume: res.volume });
})
.post("/test-connection", testConnectionDto, validator("json", testConnectionBody), async (c) => {
const body = c.req.valid("json");
const result = await volumeService.testConnection(body.config);
return c.json(result, 200);
})
.delete("/:name", deleteVolumeDto, async (c) => {
const { name } = c.req.param();
const res = await volumeService.deleteVolume(name);