From 2750e607687b91fee5e9c314c4aa76bb6e12fcfb Mon Sep 17 00:00:00 2001 From: Damodar Lohani Date: Fri, 24 Jun 2022 15:24:44 +0545 Subject: [PATCH] fix for ruby and go SDK as file params seems to be string --- app/controllers/api/functions.php | 2 +- app/controllers/api/storage.php | 2 +- app/controllers/mock.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/functions.php b/app/controllers/api/functions.php index 6b07c97045..02dbbf07ca 100644 --- a/app/controllers/api/functions.php +++ b/app/controllers/api/functions.php @@ -470,7 +470,7 @@ App::post('/v1/functions/:functionId/deployments') ->inject('project') ->inject('deviceFunctions') ->inject('deviceLocal') - ->action(function (string $functionId, string $entrypoint, array $file, bool $activate, Request $request, Response $response, Database $dbForProject, Stats $usage, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal) { + ->action(function (string $functionId, string $entrypoint, mixed $code, bool $activate, Request $request, Response $response, Database $dbForProject, Stats $usage, Event $events, Document $project, Device $deviceFunctions, Device $deviceLocal) { $function = $dbForProject->getDocument('functions', $functionId); diff --git a/app/controllers/api/storage.php b/app/controllers/api/storage.php index 2f55d97205..a3e5c249e0 100644 --- a/app/controllers/api/storage.php +++ b/app/controllers/api/storage.php @@ -356,7 +356,7 @@ App::post('/v1/storage/buckets/:bucketId/files') ->inject('mode') ->inject('deviceFiles') ->inject('deviceLocal') - ->action(function (string $bucketId, string $fileId, array $file, ?array $read, ?array $write, Request $request, Response $response, Database $dbForProject, Document $user, Audit $audits, Stats $usage, Event $events, string $mode, Device $deviceFiles, Device $deviceLocal) { + ->action(function (string $bucketId, string $fileId, mixed $file, ?array $read, ?array $write, Request $request, Response $response, Database $dbForProject, Document $user, Audit $audits, Stats $usage, Event $events, string $mode, Device $deviceFiles, Device $deviceLocal) { $bucket = Authorization::skip(fn () => $dbForProject->getDocument('buckets', $bucketId)); if ( diff --git a/app/controllers/mock.php b/app/controllers/mock.php index fb3369efc7..f681cb2482 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -237,7 +237,7 @@ App::post('/v1/mock/tests/general/upload') ->param('file', [], new File(), 'Sample file param', false) ->inject('request') ->inject('response') - ->action(function (string $x, int $y, array $z, array $file, Request $request, Response $response) { + ->action(function (string $x, int $y, array $z, mixed $file, Request $request, Response $response) { $file = $request->getFiles('file');