mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-26 13:48:46 +00:00
feat: use zod-form-data schema for dropDeployment input
Switch from z.instanceof(FormData) to uploadFileSchema (zod-form-data) so the OpenAPI generator produces a proper multipart/form-data spec with typed fields (zip as binary, applicationId, dropBuildPath). Regenerate openapi.json with the drop-deployment endpoint included.
This commit is contained in:
@@ -66,6 +66,7 @@ import {
|
|||||||
myQueue,
|
myQueue,
|
||||||
} from "@/server/queues/queueSetup";
|
} from "@/server/queues/queueSetup";
|
||||||
import { cancelDeployment, deploy } from "@/server/utils/deploy";
|
import { cancelDeployment, deploy } from "@/server/utils/deploy";
|
||||||
|
import { uploadFileSchema } from "@/utils/schema";
|
||||||
|
|
||||||
export const applicationRouter = createTRPCRouter({
|
export const applicationRouter = createTRPCRouter({
|
||||||
create: protectedProcedure
|
create: protectedProcedure
|
||||||
@@ -811,13 +812,11 @@ export const applicationRouter = createTRPCRouter({
|
|||||||
override: true,
|
override: true,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.input(z.instanceof(FormData))
|
.input(uploadFileSchema)
|
||||||
.mutation(async ({ input, ctx }) => {
|
.mutation(async ({ input, ctx }) => {
|
||||||
const formData = input;
|
const zipFile = input.zip;
|
||||||
|
const applicationId = input.applicationId as string;
|
||||||
const zipFile = formData.get("zip") as File;
|
const dropBuildPath = input.dropBuildPath ?? null;
|
||||||
const applicationId = formData.get("applicationId") as string;
|
|
||||||
const dropBuildPath = formData.get("dropBuildPath") as string | null;
|
|
||||||
|
|
||||||
const app = await findApplicationById(applicationId);
|
const app = await findApplicationById(applicationId);
|
||||||
|
|
||||||
|
|||||||
+48974
-21201
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user