mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-09 13:35:19 +00:00
Update schedule management with shell type support and version upgrades
- Updated the `drizzle-zod` package to version 0.7.1 across the project for enhanced schema validation. - Introduced a new `shellType` column in the `schedule` schema to specify the shell used for executing commands, defaulting to 'bash'. - Enhanced the `HandleSchedules` component to include the new `shellType` field, allowing users to select the shell type when creating or updating schedules. - Updated the `runCommand` utility to utilize the selected shell type when executing commands, improving flexibility in command execution. - Refactored the API to accommodate the new `shellType` in schedule creation and updates, ensuring proper handling of the new field.
This commit is contained in:
@@ -3,6 +3,7 @@ import { z } from "zod";
|
||||
import {
|
||||
createScheduleSchema,
|
||||
schedules,
|
||||
updateScheduleSchema,
|
||||
} from "@dokploy/server/db/schema/schedule";
|
||||
import { desc, eq } from "drizzle-orm";
|
||||
import { createTRPCRouter, protectedProcedure } from "../trpc";
|
||||
@@ -13,15 +14,16 @@ export const scheduleRouter = createTRPCRouter({
|
||||
create: protectedProcedure
|
||||
.input(createScheduleSchema)
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
const { scheduleId, ...rest } = input;
|
||||
const [schedule] = await ctx.db
|
||||
.insert(schedules)
|
||||
.values(input)
|
||||
.values(rest)
|
||||
.returning();
|
||||
return schedule;
|
||||
}),
|
||||
|
||||
update: protectedProcedure
|
||||
.input(createScheduleSchema.extend({ scheduleId: z.string() }))
|
||||
.input(updateScheduleSchema)
|
||||
.mutation(async ({ ctx, input }) => {
|
||||
const { scheduleId, ...rest } = input;
|
||||
const [schedule] = await ctx.db
|
||||
|
||||
Reference in New Issue
Block a user