updateEmail method
Updates the user email
to newEmail
Implementation
@override
Future<Response> updateEmail(String email, String newEmail, String jwt) {
if (email.isEmpty || newEmail.isEmpty || jwt.isEmpty) {
throw Exception('All data must be provided');
}
if (!EmailValidator.validate(email) || !EmailValidator.validate(newEmail)) {
throw Exception('E-mail must be valid');
}
return _service.updateEmail(email, newEmail, jwt);
}