feat: delete volume

This commit is contained in:
Nicolas Meienberger
2025-08-31 21:49:49 +02:00
parent 37effcb4e3
commit eb2fbe8f75
22 changed files with 282 additions and 316 deletions

View File

@@ -9,7 +9,7 @@ import { volumeConfigSchema } from "../../db/schema";
export const listVolumesResponse = type({
volumes: type({
name: "string",
mountpoint: "string",
path: "string",
createdAt: "number",
}).array(),
});
@@ -41,9 +41,12 @@ export const createVolumeBody = type({
});
export const createVolumeResponse = type({
name: "string",
mountpoint: "string",
createdAt: "number",
message: "string",
volume: type({
name: "string",
path: "string",
createdAt: "number",
}),
});
export const createVolumeDto = describeRoute({
@@ -62,3 +65,27 @@ export const createVolumeDto = describeRoute({
},
},
});
/**
* Delete a volume
*/
export const deleteVolumeResponse = type({
message: "string",
});
export const deleteVolumeDto = describeRoute({
description: "Delete a volume",
operationId: "deleteVolume",
validateResponse: true,
tags: ["Volumes"],
responses: {
200: {
description: "Volume deleted successfully",
content: {
"application/json": {
schema: resolver(deleteVolumeResponse),
},
},
},
},
});