"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.userHistoryRemoveAllValidator = exports.userHistoryRemoveElementValidator = exports.userHistoryListValidator = void 0;
const express_validator_1 = require("express-validator");
const misc_1 = require("../../helpers/custom-validators/misc");
const shared_1 = require("./shared");
const userHistoryListValidator = [
    (0, express_validator_1.query)('search')
        .optional()
        .custom(misc_1.exists),
    (req, res, next) => {
        if ((0, shared_1.areValidationErrors)(req, res))
            return;
        return next();
    }
];
exports.userHistoryListValidator = userHistoryListValidator;
const userHistoryRemoveAllValidator = [
    (0, express_validator_1.body)('beforeDate')
        .optional()
        .custom(misc_1.isDateValid).withMessage('Should have a before date that conforms to ISO 8601'),
    (req, res, next) => {
        if ((0, shared_1.areValidationErrors)(req, res))
            return;
        return next();
    }
];
exports.userHistoryRemoveAllValidator = userHistoryRemoveAllValidator;
const userHistoryRemoveElementValidator = [
    (0, express_validator_1.param)('videoId')
        .custom(misc_1.isIdValid),
    (req, res, next) => {
        if ((0, shared_1.areValidationErrors)(req, res))
            return;
        return next();
    }
];
exports.userHistoryRemoveElementValidator = userHistoryRemoveElementValidator;
//# sourceMappingURL=user-history.js.map