changeUserRoleInProject method

Future<Response> changeUserRoleInProject(
  1. String projectId,
  2. String userId,
  3. String role
)

Change a user's role in a project

Implementation

Future<Response> changeUserRoleInProject(String projectId, String userId, String role) async {
  try {
    final response = await _dio.patch(
      '/projects/$projectId/users/$userId',
      data: {
        'role': role,
      },
    );
    return response;
  } on DioException catch (e) {
    throw Exception('Failed to change user role in project: ${e.message}');
  }
}