mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-10 09:53:48 +00:00
7c1d2f4554
* refactor: remove unneeded async * chore: add express Router type to all routes * refactor: don't use index in react key * refactor: correctly get error message in excel route * refactor: avoid exporting muteable values
38 lines
1.1 KiB
TypeScript
38 lines
1.1 KiB
TypeScript
import express, { Router } from 'express';
|
|
|
|
import { paramsWithId } from '../validation-utils/validationFunction.js';
|
|
import {
|
|
deleteAutomation,
|
|
deleteTrigger,
|
|
editAutomation,
|
|
getAutomationSettings,
|
|
postAutomation,
|
|
postAutomationSettings,
|
|
postTrigger,
|
|
putTrigger,
|
|
testOutput,
|
|
} from './automation.controller.js';
|
|
import {
|
|
validateAutomation,
|
|
validateAutomationPatch,
|
|
validateAutomationSettings,
|
|
validateTestPayload,
|
|
validateTrigger,
|
|
validateTriggerPatch,
|
|
} from './automation.validation.js';
|
|
|
|
export const router: Router = express.Router();
|
|
|
|
router.get('/', getAutomationSettings);
|
|
router.post('/', validateAutomationSettings, postAutomationSettings);
|
|
|
|
router.post('/trigger', validateTrigger, postTrigger);
|
|
router.put('/trigger/:id', validateTriggerPatch, putTrigger);
|
|
router.delete('/trigger/:id', paramsWithId, deleteTrigger);
|
|
|
|
router.post('/automation', validateAutomation, postAutomation);
|
|
router.put('/automation/:id', validateAutomationPatch, editAutomation);
|
|
router.delete('/automation/:id', paramsWithId, deleteAutomation);
|
|
|
|
router.post('/test', validateTestPayload, testOutput);
|