userGrants function

  1. @riverpod
Future<List<AdminGrant>> userGrants(
  1. Ref<Object?> ref,
  2. String userId
)

Implementation

@riverpod
Future<List<AdminGrant>> userGrants(Ref ref, String userId) async {
  final ds = ref.watch(grantsDatasourceProvider);
  final models = await ds.listUserGrants(userId);
  return models.map((m) => m.toEntity()).toList();
}