updateUserClaims method

Future<Map<String, dynamic>> updateUserClaims(
  1. String userId,
  2. Map<String, dynamic> claims
)

Invites a new user into the workspace and returns Map<String,dynamic> if successful Throws UsersServiceException if failed

Implementation

Future<Map<String, dynamic>> updateUserClaims(
    String userId, Map<String, dynamic> claims) async {
  try {
    final callable = _functions.httpsCallable('callables-updateUserClaims');
    final result = await callable.call({'uid': userId, 'claims': claims});
    final updatedClaims = result.data as Map<String, dynamic>;
    return updatedClaims;
  } on FirebaseFunctionsException catch (e) {
    // Handle FirebaseFunctionsException
    throw UserDataServiceException.fromRdevException(e.toRdevException());
  } on Exception catch (e) {
    // Handle other exceptions
    throw UserDataServiceException(message: e.toString());
  }
}