updateMe method

Future<AuthUser> updateMe(
  1. ProfileUpdate update
)

Implementation

Future<AuthUser> updateMe(ProfileUpdate update) async {
  final body = <String, dynamic>{};
  if (update.firstName != null) body['firstName'] = update.firstName;
  if (update.lastName != null) body['lastName'] = update.lastName;
  if (update.email != null) body['email'] = update.email;

  final res = await dio.patch<Map<String, dynamic>>(
    endpoints.me,
    data: body,
  );
  return AuthUser.fromJson(res.data!);
}