📅  最后修改于: 2022-03-11 15:04:39.459000             🧑  作者: Mango
const { buildCheckFunction } = require('express-validator');
const checkBodyAndQuery = buildCheckFunction(['body', 'query']);
app.put(
'/update-product',
// id must be either in req.body or req.query, and must be an UUID
checkBodyAndQuery('id').isUUID(),
productUpdateHandler,
);