updatePhoneVerification method

Future<User> updatePhoneVerification({
  1. required String userId,
  2. required bool phoneVerification,
})

Update phone verification

Update the user phone verification status by its unique ID.

Implementation

Future<models.User> updatePhoneVerification(
    {required String userId, required bool phoneVerification}) async {
  final String apiPath =
      '/users/{userId}/verification/phone'.replaceAll('{userId}', userId);

  final Map<String, dynamic> apiParams = {
    'phoneVerification': phoneVerification,
  };

  final Map<String, String> apiHeaders = {
    'content-type': 'application/json',
  };

  final res = await client.call(HttpMethod.patch,
      path: apiPath, params: apiParams, headers: apiHeaders);

  return models.User.fromMap(res.data);
}