feat: use id for schedule
This commit is contained in:
@@ -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);
|
console.log(req.body);
|
||||||
try {
|
try {
|
||||||
const { fileName } = req.params;
|
const { id } = req.params;
|
||||||
const {
|
const {
|
||||||
runEvery,
|
runEvery,
|
||||||
runEveryUnit,
|
runEveryUnit,
|
||||||
@@ -267,7 +267,7 @@ router.put('/schedule/:fileName/', requireSignIn, async (req, res) => {
|
|||||||
timezone
|
timezone
|
||||||
} = req.body;
|
} = 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' });
|
return res.status(400).json({ error: 'Missing required parameters' });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -318,7 +318,7 @@ router.put('/schedule/:fileName/', requireSignIn, async (req, res) => {
|
|||||||
|
|
||||||
// await workflowQueue.add(
|
// await workflowQueue.add(
|
||||||
// 'run workflow',
|
// 'run workflow',
|
||||||
// { fileName, runId },
|
// { id, runId },
|
||||||
// {
|
// {
|
||||||
// repeat: {
|
// repeat: {
|
||||||
// pattern: cronExpression,
|
// pattern: cronExpression,
|
||||||
|
|||||||
Reference in New Issue
Block a user