1 import express from 'express'
2 import { body, param, query } from 'express-validator'
3 import { exists, isDateValid, isIdValid } from '../../helpers/custom-validators/misc'
4 import { areValidationErrors } from './shared'
6 const userHistoryListValidator = [
11 (req: express.Request, res: express.Response, next: express.NextFunction) => {
12 if (areValidationErrors(req, res)) return
18 const userHistoryRemoveAllValidator = [
21 .custom(isDateValid).withMessage('Should have a before date that conforms to ISO 8601'),
23 (req: express.Request, res: express.Response, next: express.NextFunction) => {
24 if (areValidationErrors(req, res)) return
30 const userHistoryRemoveElementValidator = [
34 (req: express.Request, res: express.Response, next: express.NextFunction) => {
35 if (areValidationErrors(req, res)) return
41 // ---------------------------------------------------------------------------
44 userHistoryListValidator,
45 userHistoryRemoveElementValidator,
46 userHistoryRemoveAllValidator