Skip to content

Commit

Permalink
refactor: finally get bucket_id
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinzent03 committed Feb 4, 2025
1 parent 70b6861 commit 4a0f9bb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion infra/storage_client/storage/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM supabase/storage-api:v1.8.2
FROM supabase/storage-api:v1.18.1

RUN apk add curl --no-cache
4 changes: 2 additions & 2 deletions packages/storage_client/lib/src/types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class FileObjectV2 {
final String id;
final String version;
final String name;
final String? bucketId;
final String bucketId;
final String? updatedAt;
final String createdAt;
final String? lastAccessedAt;
Expand Down Expand Up @@ -110,7 +110,7 @@ class FileObjectV2 {
: id = json['id'] as String,
version = json['version'] as String,
name = json['name'] as String,
bucketId = json['bucket_id'] as String?,
bucketId = json['bucket_id'] as String,
updatedAt = json['updated_at'] as String?,
createdAt = json['created_at'] as String,
lastAccessedAt = json['last_accessed_at'] as String?,
Expand Down
8 changes: 4 additions & 4 deletions packages/storage_client/test/client_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ void main() {
await storage.from('bucket2').download(uploadPath);
fail('File that does not exist was found');
} on StorageException catch (error) {
expect(error.error, 'not_found');
expect(error.statusCode, '400');
}
await storage
.from(newBucketName)
Expand All @@ -433,7 +433,7 @@ void main() {
await storage.from('bucket2').download('$uploadPath 3');
fail('File that does not exist was found');
} on StorageException catch (error) {
expect(error.error, 'not_found');
expect(error.statusCode, '400');
}
await storage
.from(newBucketName)
Expand All @@ -447,7 +447,7 @@ void main() {
await storage.from(newBucketName).download(uploadPath);
fail('File that was moved was found');
} on StorageException catch (error) {
expect(error.error, 'not_found');
expect(error.statusCode, '400');
}
});
});
Expand All @@ -473,7 +473,7 @@ void main() {

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

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

0 comments on commit 4a0f9bb

Please sign in to comment.