mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-06-16 04:35:24 +02:00
refactor(deployment): update cancellation input schemas for applications and composes
- Removed the previous cancellation schemas for deployments. - Replaced them with a unified input schema for finding applications and composes during cancellation requests. - Ensured that the cancellation logic now utilizes the new input structure for better consistency.
This commit is contained in:
@@ -62,11 +62,6 @@ import { cleanQueuesByApplication, myQueue } from "@/server/queues/queueSetup";
|
||||
import { cancelDeployment, deploy } from "@/server/utils/deploy";
|
||||
import { uploadFileSchema } from "@/utils/schema";
|
||||
|
||||
// Schema for canceling deployment
|
||||
const apiCancelDeployment = z.object({
|
||||
applicationId: z.string().min(1),
|
||||
});
|
||||
|
||||
export const applicationRouter = createTRPCRouter({
|
||||
create: protectedProcedure
|
||||
.input(apiCreateApplication)
|
||||
@@ -904,7 +899,7 @@ export const applicationRouter = createTRPCRouter({
|
||||
}),
|
||||
|
||||
cancelDeployment: protectedProcedure
|
||||
.input(apiCancelDeployment)
|
||||
.input(apiFindOneApplication)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const application = await findApplicationById(input.applicationId);
|
||||
if (
|
||||
|
||||
@@ -63,11 +63,6 @@ import { cancelDeployment, deploy } from "@/server/utils/deploy";
|
||||
import { generatePassword } from "@/templates/utils";
|
||||
import { createTRPCRouter, protectedProcedure, publicProcedure } from "../trpc";
|
||||
|
||||
// Schema for canceling deployment
|
||||
const apiCancelDeployment = z.object({
|
||||
composeId: z.string().min(1),
|
||||
});
|
||||
|
||||
export const composeRouter = createTRPCRouter({
|
||||
create: protectedProcedure
|
||||
.input(apiCreateCompose)
|
||||
@@ -936,7 +931,7 @@ export const composeRouter = createTRPCRouter({
|
||||
}),
|
||||
|
||||
cancelDeployment: protectedProcedure
|
||||
.input(apiCancelDeployment)
|
||||
.input(apiFindCompose)
|
||||
.mutation(async ({ input, ctx }) => {
|
||||
const compose = await findComposeById(input.composeId);
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user