nhost / nhost-dart

Nhost Dart & Flutter packages

Home Page:https://nhost.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

storage function uploadBytes requires "name", but the column is nullable

marcusrohden opened this issue · comments

hey guys,
I have just realised that the table "files" on storage has the column "name" set as nullable, but the uploading to storage function "uploadBytes" from the NHost dart library requires a not nullable string.

Is this intentional?

Future<FileMetadata> uploadBytes({required String fileName, required List<int> fileContents, String? fileId, String? bucketId, String mimeType = applicationOctetStreamType, UploadProgressCallback? onUploadProgress});

Yes, that's on purpose as hasura-storage needs to be able to create an empty row to verify the user has permissions to upload files.

Closing as this is intentional and there is nothing to do.

David, I mean, the library in flutter does not let it be optional. is that correct?

I did create a pull request in case the library was incorrect.

#138

Sorry, I responded too fast initially, I deleted my comment and commented in the PR instead.