@@ -146,11 +146,13 @@ Future<Response> _handleGet(
146146 startAfterId: startAfterId,
147147 limit: limit,
148148 );
149- case 'user' : // Handle User model specifically if needed, or rely on generic
149+ case 'user' :
150150 final repo = context.read <HtDataRepository <User >>();
151- // Note: readAll/readAllByQuery on User repo might need special handling
152- // depending on whether non-admins can list *all* users or just their own.
153- // Assuming for now readAll/readAllByQuery with userId scopes to owned.
151+ // Note: While readAll/readAllByQuery is used here for consistency
152+ // with the generic endpoint, fetching a specific user by ID via
153+ // the /data/[id] route is the semantically preferred method.
154+ // The userIdForRepoCall ensures scoping to the authenticated user
155+ // if the repository supports it.
154156 paginatedResponse = specificQuery.isNotEmpty
155157 ? await repo.readAllByQuery (
156158 specificQuery,
@@ -163,8 +165,12 @@ Future<Response> _handleGet(
163165 startAfterId: startAfterId,
164166 limit: limit,
165167 );
166- case 'user_app_settings' : // New case for UserAppSettings
168+ case 'user_app_settings' :
167169 final repo = context.read <HtDataRepository <UserAppSettings >>();
170+ // Note: While readAll/readAllByQuery is used here for consistency
171+ // with the generic endpoint, fetching the user's settings by ID
172+ // via the /data/[id] route is the semantically preferred method
173+ // for this single-instance, user-owned model.
168174 paginatedResponse = specificQuery.isNotEmpty
169175 ? await repo.readAllByQuery (
170176 specificQuery,
@@ -177,8 +183,12 @@ Future<Response> _handleGet(
177183 startAfterId: startAfterId,
178184 limit: limit,
179185 );
180- case 'user_content_preferences' : // New case for UserContentPreferences
186+ case 'user_content_preferences' :
181187 final repo = context.read <HtDataRepository <UserContentPreferences >>();
188+ // Note: While readAll/readAllByQuery is used here for consistency
189+ // with the generic endpoint, fetching the user's preferences by ID
190+ // via the /data/[id] route is the semantically preferred method
191+ // for this single-instance, user-owned model.
182192 paginatedResponse = specificQuery.isNotEmpty
183193 ? await repo.readAllByQuery (
184194 specificQuery,
@@ -191,8 +201,12 @@ Future<Response> _handleGet(
191201 startAfterId: startAfterId,
192202 limit: limit,
193203 );
194- case 'app_config' : // New case for AppConfig (read by admin)
204+ case 'app_config' :
195205 final repo = context.read <HtDataRepository <AppConfig >>();
206+ // Note: While readAll/readAllByQuery is used here for consistency
207+ // with the generic endpoint, fetching the single AppConfig instance
208+ // by its fixed ID ('app_config') via the /data/[id] route is the
209+ // semantically preferred method for this global singleton model.
196210 paginatedResponse = specificQuery.isNotEmpty
197211 ? await repo.readAllByQuery (
198212 specificQuery,
0 commit comments