Skip to content

Commit 32fc41d

Browse files
authored
Explicit injection of Storage into ApiExporter. (#8275)
1 parent 8b9b9ec commit 32fc41d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

app/lib/package/api_export/api_exporter.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ final class ApiExporter {
5050

5151
ApiExporter(
5252
this._db, {
53+
required Storage storageService,
5354
required Bucket bucket,
5455
}) : _api = ExportedApi(storageService, bucket);
5556

app/lib/service/services.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ Future<R> _withPubServices<R>(FutureOr<R> Function() fn) async {
246246
if (activeConfiguration.exportedApiBucketName != null) {
247247
registerApiExporter(ApiExporter(
248248
dbService,
249+
storageService: storageService,
249250
bucket:
250251
storageService.bucket(activeConfiguration.exportedApiBucketName!),
251252
));

app/test/package/api_export/api_exporter_test.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ void main() {
4747
(fakeTime) async {
4848
await storageService.createBucket('bucket');
4949
final bucket = storageService.bucket('bucket');
50-
final apiExporter = ApiExporter(dbService, bucket: bucket);
50+
final apiExporter =
51+
ApiExporter(dbService, storageService: storageService, bucket: bucket);
5152

5253
await _testExportedApiSynchronization(
5354
fakeTime,
@@ -62,7 +63,8 @@ void main() {
6263
(fakeTime) async {
6364
await storageService.createBucket('bucket');
6465
final bucket = storageService.bucket('bucket');
65-
final apiExporter = ApiExporter(dbService, bucket: bucket);
66+
final apiExporter = ApiExporter(dbService,
67+
storageService: storageService, bucket: bucket);
6668

6769
await apiExporter.synchronizeExportedApi();
6870

0 commit comments

Comments
 (0)