@@ -2,7 +2,6 @@ import 'package:core/core.dart';
22import 'package:dart_frog/dart_frog.dart' ;
33import 'package:data_repository/data_repository.dart' ;
44import 'package:flutter_news_app_api_server_full_source_code/src/middlewares/ownership_check_middleware.dart' ;
5- import 'package:flutter_news_app_api_server_full_source_code/src/services/country_service.dart' ;
65import 'package:flutter_news_app_api_server_full_source_code/src/services/dashboard_summary_service.dart' ;
76
87// --- Typedefs for Data Operations ---
@@ -129,32 +128,12 @@ class DataOperationRegistry {
129128 sort: s,
130129 pagination: p,
131130 ),
132- 'country' : (c, uid, f, s, p) async {
133- final usage = f? ['usage' ] as String ? ;
134- final name = f? ['name' ] as String ? ;
135- 136- // If either 'usage' or 'name' filter is present, delegate to CountryService.
137- // Sorting and pagination are handled by CountryService for these specialized queries.
138- if ((usage != null && usage.isNotEmpty) ||
139- (name != null && name.isNotEmpty)) {
140- final countryService = c.read <CountryService >();
141- final countries = await countryService.getCountries (f);
142- return PaginatedResponse <Country >(
143- items: countries,
144- cursor: null , // No cursor for this type of filtered list
145- hasMore: false , // No more items as it's a complete filtered set
146- );
147- } else {
148- // For standard requests without specialized filters, use the repository
149- // which supports pagination/sorting.
150- return c.read <DataRepository <Country >>().readAll (
151- userId: uid,
152- filter: f,
153- sort: s,
154- pagination: p,
155- );
156- }
157- },
131+ 'country' : (c, uid, f, s, p) => c.read <DataRepository <Country >>().readAll (
132+ userId: uid,
133+ filter: f,
134+ sort: s,
135+ pagination: p,
136+ ),
158137 'language' : (c, uid, f, s, p) => c
159138 .read <DataRepository <Language >>()
160139 .readAll (userId: uid, filter: f, sort: s, pagination: p),
0 commit comments