Skip to content

Commit

Permalink
suggested changes - 2
Browse files Browse the repository at this point in the history
- prune upload intent for sdks
- remove server-ignored form_params
  • Loading branch information
Arpit-Sharma-USC committed Dec 29, 2020
1 parent 089d338 commit a1e3321
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/Bynder/Api/Impl/Upload/FileUploader.php
Expand Up @@ -154,8 +154,7 @@ private function finalizeFile($fileId, $filePath, $fileSize, $chunksCount, $file
'fileName' => basename($filePath),
'fileSize' => $fileSize,
'chunksCount' => $chunksCount,
'sha256' => $fileSha256,
'intent' => "upload_main_uploader_asset"
'sha256' => $fileSha256
);

$this->requestHandler->sendRequestAsync(
Expand Down Expand Up @@ -183,7 +182,7 @@ private function saveMediaAsync($fileId, $data)
if (isset($data['mediaId'])) {
$uri = sprintf("api/v4/media/" . $data['mediaId'] . "/save/" . $fileId);
unset($data['mediaId']);
return $this->requestHandler->sendRequestAsync('POST', $uri, ['form_params' => $data]);
return $this->requestHandler->sendRequestAsync('POST', $uri);
}

// If the mediaId is missing then save the file as a new asset in which case a brandId must be specified.
Expand Down
3 changes: 1 addition & 2 deletions tests/AssetBank/FileUploaderTest.php
Expand Up @@ -282,8 +282,7 @@ private static function getFinaliseApiRequest($fileId, $fileName, $fileSize, $ch
'fileName' => $fileName,
'fileSize' => $fileSize,
'chunksCount' => $chunksCount,
'sha256' => $fileSha256,
'intent' => "upload_main_uploader_asset"
'sha256' => $fileSha256
]
]
];
Expand Down

0 comments on commit a1e3321

Please sign in to comment.