Skip to content

Commit 3a69f02

Browse files
committed
Fixed file param bug
1 parent 3e4af02 commit 3a69f02

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

docs/examples/functions/create-tag.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void main() { // Init SDK
1313
Future result = functions.createTag(
1414
functionId: '[FUNCTION_ID]',
1515
command: '[COMMAND]',
16-
code: '',
16+
code: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'),
1717
);
1818

1919
result

docs/examples/storage/create-file.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void main() { // Init SDK
1212
;
1313

1414
Future result = storage.createFile(
15-
file: '',
15+
file: await MultipartFile.fromFile('./path-to-files/image.jpg', 'image.jpg'),
1616
);
1717

1818
result

lib/services/functions.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ class Functions extends Service {
226226
///
227227
/// Use the "command" param to set the entry point used to execute your code.
228228
///
229-
Future<Response> createTag({required String functionId, required String command, required String code}) {
229+
Future<Response> createTag({required String functionId, required String command, required MultipartFile code}) {
230230
final String path = '/functions/{functionId}/tags'.replaceAll(RegExp('{functionId}'), functionId);
231231

232232
final Map<String, dynamic> params = {

lib/services/storage.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Storage extends Service {
3333
/// assigned to read and write access unless he has passed custom values for
3434
/// read and write arguments.
3535
///
36-
Future<Response> createFile({required String file, List read = const [], List write = const []}) {
36+
Future<Response> createFile({required MultipartFile file, List read = const [], List write = const []}) {
3737
final String path = '/storage/files';
3838

3939
final Map<String, dynamic> params = {

0 commit comments

Comments
 (0)