"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const error_1 = require("../error");
const idNumberMiddleware = () => {
    return async (req, res, next) => {
        const { id } = req.params;
        if (!Number.isInteger(Number(id))) {
            res.status(400).send(new error_1.BadDataError('ID should be an integer').toJSON());
            return;
        }
        next();
    };
};
exports.default = idNumberMiddleware;
//# sourceMappingURL=id-number-middleware.js.map