@@ -148,6 +148,20 @@ HtDataRepository<AppConfig> _createAppConfigRepository() {
148
148
return HtDataRepository <AppConfig >(dataClient: client);
149
149
}
150
150
151
+ HtDataRepository <DashboardSummary > _createDashboardSummaryRepository () {
152
+ print ('Initializing DashboardSummary Repository...' );
153
+ final initialData = [
154
+ DashboardSummary .fromJson (dashboardSummaryFixtureData),
155
+ ];
156
+ final client = HtDataInMemory <DashboardSummary >(
157
+ toJson: (i) => i.toJson (),
158
+ getId: (i) => i.id,
159
+ initialData: initialData,
160
+ );
161
+ print ('DashboardSummary Repository Initialized.' );
162
+ return HtDataRepository <DashboardSummary >(dataClient: client);
163
+ }
164
+
151
165
/// Middleware to asynchronously load and provide the AppConfig.
152
166
Middleware _appConfigProviderMiddleware () {
153
167
return (handler) {
@@ -174,6 +188,7 @@ Handler middleware(Handler handler) {
174
188
final userContentPreferencesRepository =
175
189
_createUserContentPreferencesRepository ();
176
190
final appConfigRepository = _createAppConfigRepository ();
191
+ final dashboardSummaryRepository = _createDashboardSummaryRepository ();
177
192
178
193
const uuid = Uuid ();
179
194
@@ -286,6 +301,11 @@ Handler middleware(Handler handler) {
286
301
),
287
302
)
288
303
.use (provider <HtDataRepository <AppConfig >>((_) => appConfigRepository))
304
+ .use (
305
+ provider <HtDataRepository <DashboardSummary >>(
306
+ (_) => dashboardSummaryRepository,
307
+ ),
308
+ )
289
309
// ORDER: These MUST be provided BEFORE `authenticationProvider` and
290
310
// any route handlers that perform authentication/authorization.
291
311
// - `Uuid` is used by `AuthService` and `JwtAuthTokenService`.
0 commit comments