Skip to content

Commit 4a0f9bb

Browse files
committed
refactor: finally get bucket_id
1 parent 70b6861 commit 4a0f9bb

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
FROM supabase/storage-api:v1.8.2
1+
FROM supabase/storage-api:v1.18.1
22

33
RUN apk add curl --no-cache

packages/storage_client/lib/src/types.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class FileObjectV2 {
7979
final String id;
8080
final String version;
8181
final String name;
82-
final String? bucketId;
82+
final String bucketId;
8383
final String? updatedAt;
8484
final String createdAt;
8585
final String? lastAccessedAt;
@@ -110,7 +110,7 @@ class FileObjectV2 {
110110
: id = json['id'] as String,
111111
version = json['version'] as String,
112112
name = json['name'] as String,
113-
bucketId = json['bucket_id'] as String?,
113+
bucketId = json['bucket_id'] as String,
114114
updatedAt = json['updated_at'] as String?,
115115
createdAt = json['created_at'] as String,
116116
lastAccessedAt = json['last_accessed_at'] as String?,

packages/storage_client/test/client_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void main() {
413413
await storage.from('bucket2').download(uploadPath);
414414
fail('File that does not exist was found');
415415
} on StorageException catch (error) {
416-
expect(error.error, 'not_found');
416+
expect(error.statusCode, '400');
417417
}
418418
await storage
419419
.from(newBucketName)
@@ -433,7 +433,7 @@ void main() {
433433
await storage.from('bucket2').download('$uploadPath 3');
434434
fail('File that does not exist was found');
435435
} on StorageException catch (error) {
436-
expect(error.error, 'not_found');
436+
expect(error.statusCode, '400');
437437
}
438438
await storage
439439
.from(newBucketName)
@@ -447,7 +447,7 @@ void main() {
447447
await storage.from(newBucketName).download(uploadPath);
448448
fail('File that was moved was found');
449449
} on StorageException catch (error) {
450-
expect(error.error, 'not_found');
450+
expect(error.statusCode, '400');
451451
}
452452
});
453453
});
@@ -473,7 +473,7 @@ void main() {
473473

474474
test('check if object exists', () async {
475475
await storage.from(newBucketName).upload('$uploadPath-exists', file);
476-
final res = await storage.from(newBucketName).exists(uploadPath);
476+
final res = await storage.from(newBucketName).exists('$uploadPath-exists');
477477
expect(res, true);
478478

479479
final res2 = await storage.from(newBucketName).exists('not-exist');

0 commit comments

Comments
 (0)