mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 07:29:08 +00:00
feat: granular endpoints for rundown
This commit is contained in:
committed by
Carlos Valente
parent
e6c3322321
commit
917b182e39
@@ -1,4 +1,4 @@
|
||||
import { body, param, validationResult } from 'express-validator';
|
||||
import { body, param, query, validationResult } from 'express-validator';
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
|
||||
export const rundownPostValidator = [
|
||||
@@ -75,3 +75,14 @@ export const rundownArrayOfIds = [
|
||||
next();
|
||||
},
|
||||
];
|
||||
|
||||
export const rundownGetPaginatedQueryParams = [
|
||||
query('offset').isNumeric().optional(),
|
||||
query('limit').isNumeric().optional(),
|
||||
|
||||
(req: Request, res: Response, next: NextFunction) => {
|
||||
const errors = validationResult(req);
|
||||
if (!errors.isEmpty()) return res.status(422).json({ errors: errors.array() });
|
||||
next();
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user