@@ -99,8 +99,8 @@ Future<Response> _handleGet(
99
99
case 'headline' :
100
100
final repo = context.read <HtDataRepository <Headline >>();
101
101
item = await repo.read (id: id, userId: userIdForRepoCall);
102
- case 'category ' :
103
- final repo = context.read <HtDataRepository <Category >>();
102
+ case 'topic ' :
103
+ final repo = context.read <HtDataRepository <Topic >>();
104
104
item = await repo.read (id: id, userId: userIdForRepoCall);
105
105
case 'source' :
106
106
final repo = context.read <HtDataRepository <Source >>();
@@ -117,8 +117,8 @@ Future<Response> _handleGet(
117
117
case 'user_content_preferences' : // New case for UserContentPreferences
118
118
final repo = context.read <HtDataRepository <UserContentPreferences >>();
119
119
item = await repo.read (id: id, userId: userIdForRepoCall);
120
- case 'app_config ' : // New case for AppConfig (read by admin)
121
- final repo = context.read <HtDataRepository <AppConfig >>();
120
+ case 'remote_config ' : // New case for RemoteConfig (read by admin)
121
+ final repo = context.read <HtDataRepository <RemoteConfig >>();
122
122
item = await repo.read (
123
123
id: id,
124
124
userId: userIdForRepoCall,
@@ -296,12 +296,12 @@ Future<Response> _handlePut(
296
296
userId: userIdForRepoCall,
297
297
);
298
298
}
299
- case 'category ' :
299
+ case 'topic ' :
300
300
{
301
- final repo = context.read <HtDataRepository <Category >>();
301
+ final repo = context.read <HtDataRepository <Topic >>();
302
302
updatedItem = await repo.update (
303
303
id: id,
304
- item: itemToUpdate as Category ,
304
+ item: itemToUpdate as Topic ,
305
305
userId: userIdForRepoCall,
306
306
);
307
307
}
@@ -350,12 +350,12 @@ Future<Response> _handlePut(
350
350
userId: userIdForRepoCall,
351
351
);
352
352
}
353
- case 'app_config ' : // New case for AppConfig (update by admin)
353
+ case 'remote_config ' : // New case for RemoteConfig (update by admin)
354
354
{
355
- final repo = context.read <HtDataRepository <AppConfig >>();
355
+ final repo = context.read <HtDataRepository <RemoteConfig >>();
356
356
updatedItem = await repo.update (
357
357
id: id,
358
- item: itemToUpdate as AppConfig ,
358
+ item: itemToUpdate as RemoteConfig ,
359
359
userId: userIdForRepoCall, // userId should be null for AppConfig
360
360
);
361
361
}
@@ -474,8 +474,8 @@ Future<Response> _handleDelete(
474
474
case 'headline' :
475
475
final repo = context.read <HtDataRepository <Headline >>();
476
476
itemToDelete = await repo.read (id: id, userId: userIdForRepoCall);
477
- case 'category ' :
478
- final repo = context.read <HtDataRepository <Category >>();
477
+ case 'topic ' :
478
+ final repo = context.read <HtDataRepository <Topic >>();
479
479
itemToDelete = await repo.read (id: id, userId: userIdForRepoCall);
480
480
case 'source' :
481
481
final repo = context.read <HtDataRepository <Source >>();
@@ -492,8 +492,8 @@ Future<Response> _handleDelete(
492
492
case 'user_content_preferences' : // New case for UserContentPreferences
493
493
final repo = context.read <HtDataRepository <UserContentPreferences >>();
494
494
itemToDelete = await repo.read (id: id, userId: userIdForRepoCall);
495
- case 'app_config ' : // New case for AppConfig (delete by admin)
496
- final repo = context.read <HtDataRepository <AppConfig >>();
495
+ case 'remote_config ' : // New case for RemoteConfig (delete by admin)
496
+ final repo = context.read <HtDataRepository <RemoteConfig >>();
497
497
itemToDelete = await repo.read (
498
498
id: id,
499
499
userId: userIdForRepoCall,
@@ -531,8 +531,8 @@ Future<Response> _handleDelete(
531
531
id: id,
532
532
userId: userIdForRepoCall,
533
533
);
534
- case 'category ' :
535
- await context.read <HtDataRepository <Category >>().delete (
534
+ case 'topic ' :
535
+ await context.read <HtDataRepository <Topic >>().delete (
536
536
id: id,
537
537
userId: userIdForRepoCall,
538
538
);
@@ -561,8 +561,8 @@ Future<Response> _handleDelete(
561
561
id: id,
562
562
userId: userIdForRepoCall,
563
563
);
564
- case 'app_config ' : // New case for AppConfig (delete by admin)
565
- await context.read <HtDataRepository <AppConfig >>().delete (
564
+ case 'remote_config ' : // New case for RemoteConfig (delete by admin)
565
+ await context.read <HtDataRepository <RemoteConfig >>().delete (
566
566
id: id,
567
567
userId: userIdForRepoCall,
568
568
); // userId should be null for AppConfig
0 commit comments