validateData method
Validates the request body against the given rules.
Implementation
Future<Map<String, dynamic>> validateData(
Map<String, String> rules, [
Map<String, String>? messages,
]) async {
final res = await Validator.validate(body, rules, messages);
if (res.fails) {
throw ValidationException(res.errors);
}
return res.data;
}