fetch changes from branch export_to_lims
This commit is contained in:
@@ -206,13 +206,12 @@ class VisualLimsApiClient
|
||||
/**
|
||||
* POST a file as multipart/form-data (used for photo/attachment uploads).
|
||||
*
|
||||
* @param string $endpoint OData endpoint, e.g. "AllegatoCommessaWeb"
|
||||
* @param string $filePath Absolute path to the file on disk
|
||||
* @param string $fileName Original file name to send
|
||||
* @param int $commessaId CommessaWeb ID to link the attachment to
|
||||
* @return array|null Decoded JSON response
|
||||
* @param string $endpoint OData endpoint, e.g. "Campione(613388)/UploadCampioneFile"
|
||||
* @param string $filePath Absolute path to the file on disk
|
||||
* @param string $fileName Original file name to send
|
||||
* @return array|null Decoded JSON response
|
||||
*/
|
||||
public function postMultipart($endpoint, $filePath, $fileName, $commessaId)
|
||||
public function postMultipart($endpoint, $filePath, $fileName)
|
||||
{
|
||||
$token = $this->getToken();
|
||||
$url = "{$this->baseUrl}/api/odata/{$endpoint}";
|
||||
@@ -220,9 +219,7 @@ class VisualLimsApiClient
|
||||
$cfile = new CURLFile($filePath, mime_content_type($filePath) ?: 'application/octet-stream', $fileName);
|
||||
|
||||
$payload = [
|
||||
'IdCommessa' => $commessaId,
|
||||
'NomeFile' => $fileName,
|
||||
'file' => $cfile,
|
||||
'file' => $cfile,
|
||||
];
|
||||
|
||||
$ch = curl_init($url);
|
||||
|
||||
@@ -126,9 +126,9 @@ class VisualLimsApiClientMock
|
||||
return [];
|
||||
}
|
||||
|
||||
public function postMultipart(string $endpoint, string $filePath, string $fileName, int $commessaId): array
|
||||
public function postMultipart(string $endpoint, string $filePath, string $fileName): array
|
||||
{
|
||||
error_log("[SIMULATE] POST multipart {$endpoint} file={$fileName} commessaId={$commessaId}");
|
||||
error_log("[SIMULATE] POST multipart {$endpoint} file={$fileName}");
|
||||
|
||||
return ['simulated' => true, 'file' => $fileName];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user