if (!errors.isEmpty()) {
    return res.status(400).json({ errors: errors.array() });
  }