mirror of
https://github.com/andwati/dokploy.git
synced 2026-10-18 11:12:56 +00:00
- Introduced a new component `ShowSchedulesLogs` to display logs for each schedule, allowing users to view deployment logs associated with their schedules. - Updated the `ShowSchedules` component to integrate the new logs feature, providing a button to access logs for each schedule. - Enhanced the `schedule` schema by adding an `appName` column to better identify applications associated with schedules. - Updated the API to support fetching deployments with their associated schedules, improving data retrieval for the frontend. - Implemented utility functions for managing schedule-related operations, including creating and removing deployments linked to schedules.
22 lines
493 B
TypeScript
22 lines
493 B
TypeScript
import { schedules } from "../db/schema/schedule";
|
|
import { db } from "../db";
|
|
import { eq } from "drizzle-orm";
|
|
import { TRPCError } from "@trpc/server";
|
|
|
|
export const findScheduleById = async (scheduleId: string) => {
|
|
const schedule = await db.query.schedules.findFirst({
|
|
where: eq(schedules.scheduleId, scheduleId),
|
|
with: {
|
|
application: true,
|
|
},
|
|
});
|
|
|
|
if (!schedule) {
|
|
throw new TRPCError({
|
|
code: "NOT_FOUND",
|
|
message: "Schedule not found",
|
|
});
|
|
}
|
|
return schedule;
|
|
};
|