badRequest method

Response badRequest([
  1. String? message
])

Implementation

Response badRequest([String? message]) {
  const status = 422;
  if (message == null) return response.status(status);
  return response.json({'error': message}, statusCode: status);
}