getAllForCurrentUser method

Future<List<UserAiSettingsModel>> getAllForCurrentUser()

Fetch all providers' rows for the current user. Used by the post-auth hydration provider to warm the local cache for every provider in one round-trip.

Implementation

Future<List<UserAiSettingsModel>> getAllForCurrentUser() async {
  final userId = _client.auth.currentUser?.id;
  if (userId == null) return const [];
  final response = await _client
      .from('user_ai_settings')
      .select()
      .eq('user_id', userId);
  return (response as List<dynamic>)
      .map((row) => UserAiSettingsModel.fromJson(row as Map<String, dynamic>))
      .toList();
}