Allow Run Now on paused routines
The server rejected manual runs for any non-active routine. Now only archived routines are blocked — paused routines can still be triggered manually via "Run now". Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -885,7 +885,7 @@ export function routineService(db: Db) {
|
||||
runRoutine: async (id: string, input: RunRoutine) => {
|
||||
const routine = await getRoutineById(id);
|
||||
if (!routine) throw notFound("Routine not found");
|
||||
if (routine.status !== "active") throw conflict("Routine is not active");
|
||||
if (routine.status === "archived") throw conflict("Routine is archived");
|
||||
const trigger = input.triggerId ? await getTriggerById(input.triggerId) : null;
|
||||
if (trigger && trigger.routineId !== routine.id) throw forbidden("Trigger does not belong to routine");
|
||||
if (trigger && !trigger.enabled) throw conflict("Routine trigger is not active");
|
||||
|
||||
Reference in New Issue
Block a user