Skip to content

Commit

Permalink
Fixed file param bug
Browse files Browse the repository at this point in the history
  • Loading branch information
eldadfux committed May 21, 2021
1 parent 3e4af02 commit 3a69f02
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/examples/functions/create-tag.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/storage/create-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/services/functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ class Functions extends Service {
///
/// Use the "command" param to set the entry point used to execute your code.
///
Future<Response> createTag({required String functionId, required String command, required String code}) {
Future<Response> createTag({required String functionId, required String command, required MultipartFile code}) {
final String path = '/functions/{functionId}/tags'.replaceAll(RegExp('{functionId}'), functionId);

final Map<String, dynamic> params = {
Expand Down
2 changes: 1 addition & 1 deletion lib/services/storage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Response> createFile({required String file, List read = const [], List write = const []}) {
Future<Response> createFile({required MultipartFile file, List read = const [], List write = const []}) {
final String path = '/storage/files';

final Map<String, dynamic> params = {
Expand Down

0 comments on commit 3a69f02

Please sign in to comment.