feat: add host path to any container

This commit is contained in:
Andras Bacsai
2023-03-07 11:15:05 +01:00
parent 3e81d7e9cb
commit 1c237affb4
8 changed files with 60 additions and 18 deletions

View File

@@ -1340,16 +1340,16 @@ export async function getStorages(request: FastifyRequest<OnlyId>) {
export async function saveStorage(request: FastifyRequest<SaveStorage>, reply: FastifyReply) {
try {
const { id } = request.params;
const { path, newStorage, storageId } = request.body;
const { hostPath, path, newStorage, storageId } = request.body;
if (newStorage) {
await prisma.applicationPersistentStorage.create({
data: { path, application: { connect: { id } } }
data: { hostPath, path, application: { connect: { id } } }
});
} else {
await prisma.applicationPersistentStorage.update({
where: { id: storageId },
data: { path }
data: { hostPath, path }
});
}
return reply.code(201).send();

View File

@@ -96,6 +96,7 @@ export interface DeleteSecret extends OnlyId {
}
export interface SaveStorage extends OnlyId {
Body: {
hostPath?: string;
path: string;
newStorage: boolean;
storageId: string;