From 079110edca0efc26ad179121812e4a1306fb0378 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Thu, 10 Oct 2024 02:39:45 +0530 Subject: [PATCH] feat: use id for schedule --- server/src/routes/storage.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/routes/storage.ts b/server/src/routes/storage.ts index ab2af9ec..7dcb2373 100644 --- a/server/src/routes/storage.ts +++ b/server/src/routes/storage.ts @@ -255,10 +255,10 @@ router.post('/runs/run/:id', requireSignIn, async (req, res) => { } }); -router.put('/schedule/:fileName/', requireSignIn, async (req, res) => { +router.put('/schedule/:id/', requireSignIn, async (req, res) => { console.log(req.body); try { - const { fileName } = req.params; + const { id } = req.params; const { runEvery, runEveryUnit, @@ -267,7 +267,7 @@ router.put('/schedule/:fileName/', requireSignIn, async (req, res) => { timezone } = req.body; - if (!fileName || !runEvery || !runEveryUnit || !startFrom || !atTime || !timezone) { + if (!id || !runEvery || !runEveryUnit || !startFrom || !atTime || !timezone) { return res.status(400).json({ error: 'Missing required parameters' }); } @@ -318,7 +318,7 @@ router.put('/schedule/:fileName/', requireSignIn, async (req, res) => { // await workflowQueue.add( // 'run workflow', - // { fileName, runId }, + // { id, runId }, // { // repeat: { // pattern: cronExpression,