From 32fc41d76aba6dc41fb1bb6b5f6c92e9be4ae219 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20So=C3=B3s?= Date: Thu, 14 Nov 2024 10:32:27 +0100 Subject: [PATCH] Explicit injection of Storage into ApiExporter. (#8275) --- app/lib/package/api_export/api_exporter.dart | 1 + app/lib/service/services.dart | 1 + app/test/package/api_export/api_exporter_test.dart | 6 ++++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/lib/package/api_export/api_exporter.dart b/app/lib/package/api_export/api_exporter.dart index 194e32f93..5babe660c 100644 --- a/app/lib/package/api_export/api_exporter.dart +++ b/app/lib/package/api_export/api_exporter.dart @@ -50,6 +50,7 @@ final class ApiExporter { ApiExporter( this._db, { + required Storage storageService, required Bucket bucket, }) : _api = ExportedApi(storageService, bucket); diff --git a/app/lib/service/services.dart b/app/lib/service/services.dart index 92cd57709..5cc872b18 100644 --- a/app/lib/service/services.dart +++ b/app/lib/service/services.dart @@ -246,6 +246,7 @@ Future _withPubServices(FutureOr Function() fn) async { if (activeConfiguration.exportedApiBucketName != null) { registerApiExporter(ApiExporter( dbService, + storageService: storageService, bucket: storageService.bucket(activeConfiguration.exportedApiBucketName!), )); diff --git a/app/test/package/api_export/api_exporter_test.dart b/app/test/package/api_export/api_exporter_test.dart index b286e3ee8..9548638cc 100644 --- a/app/test/package/api_export/api_exporter_test.dart +++ b/app/test/package/api_export/api_exporter_test.dart @@ -47,7 +47,8 @@ void main() { (fakeTime) async { await storageService.createBucket('bucket'); final bucket = storageService.bucket('bucket'); - final apiExporter = ApiExporter(dbService, bucket: bucket); + final apiExporter = + ApiExporter(dbService, storageService: storageService, bucket: bucket); await _testExportedApiSynchronization( fakeTime, @@ -62,7 +63,8 @@ void main() { (fakeTime) async { await storageService.createBucket('bucket'); final bucket = storageService.bucket('bucket'); - final apiExporter = ApiExporter(dbService, bucket: bucket); + final apiExporter = ApiExporter(dbService, + storageService: storageService, bucket: bucket); await apiExporter.synchronizeExportedApi();