From 3a69f02b9c616beb6371bb99d6794eab919b3cbf Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Fri, 21 May 2021 17:01:01 +0300 Subject: [PATCH] Fixed file param bug --- docs/examples/functions/create-tag.md | 2 +- docs/examples/storage/create-file.md | 2 +- lib/services/functions.dart | 2 +- lib/services/storage.dart | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/examples/functions/create-tag.md b/docs/examples/functions/create-tag.md index 01028b7..a7350fd 100644 --- a/docs/examples/functions/create-tag.md +++ b/docs/examples/functions/create-tag.md @@ -13,7 +13,7 @@ void main() { // Init SDK Future result = functions.createTag( functionId: '[FUNCTION_ID]', command: '[COMMAND]', - code: '', + code: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'), ); result diff --git a/docs/examples/storage/create-file.md b/docs/examples/storage/create-file.md index 68a862b..ed0805b 100644 --- a/docs/examples/storage/create-file.md +++ b/docs/examples/storage/create-file.md @@ -12,7 +12,7 @@ void main() { // Init SDK ; Future result = storage.createFile( - file: '', + file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'), ); result diff --git a/lib/services/functions.dart b/lib/services/functions.dart index f43aef7..634bf56 100644 --- a/lib/services/functions.dart +++ b/lib/services/functions.dart @@ -226,7 +226,7 @@ class Functions extends Service { /// /// Use the "command" param to set the entry point used to execute your code. /// - Future createTag({required String functionId, required String command, required String code}) { + Future createTag({required String functionId, required String command, required MultipartFile code}) { final String path = '/functions/{functionId}/tags'.replaceAll(RegExp('{functionId}'), functionId); final Map params = { diff --git a/lib/services/storage.dart b/lib/services/storage.dart index 7839603..be27d38 100644 --- a/lib/services/storage.dart +++ b/lib/services/storage.dart @@ -33,7 +33,7 @@ class Storage extends Service { /// assigned to read and write access unless he has passed custom values for /// read and write arguments. /// - Future createFile({required String file, List read = const [], List write = const []}) { + Future createFile({required MultipartFile file, List read = const [], List write = const []}) { final String path = '/storage/files'; final Map params = {