updateUser method
Implementation
Future<void> updateUser({
required String accessToken,
String? firstName,
String? lastName,
}) async {
final body = <String, dynamic>{};
if (firstName != null) {
body['firstName'] = firstName;
}
if (lastName != null) {
body['lastName'] = lastName;
}
final response = await _patch(
path: '/users/me',
body: body,
accessToken: accessToken,
);
if (response.statusCode >= 400) {
final json = jsonDecode(response.body);
return Future.error(ApiError.fromJson(json));
}
return;
}