mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-21 22:05:23 +02:00
fix(schedule): give scheduleType a clean enum type for the host-access gate
createInsertSchema inferred scheduleType as a broadened union (drizzle-zod 0.5.1), so passing input.scheduleType into assertHostScheduleAccess failed typecheck on a cold build. Refine the insert schema's scheduleType to a plain z.enum and type the helper param as the schedule enum.
This commit is contained in:
@@ -22,7 +22,7 @@ export type ScheduleExtended = Awaited<ReturnType<typeof findScheduleById>>;
|
||||
// not downgrade this to a service-access check.
|
||||
export const assertHostScheduleAccess = async (
|
||||
ctx: { user: { id: string }; session: { activeOrganizationId: string } },
|
||||
scheduleType: string | undefined,
|
||||
scheduleType: Schedule["scheduleType"] | null | undefined,
|
||||
serverId: string | null | undefined,
|
||||
) => {
|
||||
if (scheduleType !== "server" && scheduleType !== "dokploy-server") return;
|
||||
|
||||
Reference in New Issue
Block a user