"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listJobsValidator = void 0;
const express_validator_1 = require("express-validator");
const jobs_1 = require("../../helpers/custom-validators/jobs");
const logger_1 = require("../../helpers/logger");
const shared_1 = require("./shared");
const lTags = (0, logger_1.loggerTagsFactory)('validators', 'jobs');
const listJobsValidator = [
    (0, express_validator_1.param)('state')
        .optional()
        .custom(jobs_1.isValidJobState),
    (0, express_validator_1.query)('jobType')
        .optional()
        .custom(jobs_1.isValidJobType),
    (req, res, next) => {
        if ((0, shared_1.areValidationErrors)(req, res, lTags()))
            return;
        return next();
    }
];
exports.listJobsValidator = listJobsValidator;
//# sourceMappingURL=jobs.js.map