Merge pull request #28999 from lamrani002/fixApi_Shipment

Fix return method deleteLine (PHPStan warnings
This commit is contained in:
Laurent Destailleur 2024-03-24 05:26:55 +01:00 committed by GitHub
commit 5dbd99bf95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -386,7 +386,7 @@ class Shipments extends DolibarrApi
*
* @url DELETE {id}/lines/{lineid}
*
* @return int
* @return array
*
* @throws RestException 401
* @throws RestException 404
@ -410,7 +410,12 @@ class Shipments extends DolibarrApi
$updateRes = $this->shipment->deleteLine(DolibarrApiAccess::$user, $lineid);
if ($updateRes > 0) {
return $this->get($id);
return array(
'success' => array(
'code' => 200,
'message' => 'line ' .$lineid. ' deleted'
)
);
} else {
throw new RestException(405, $this->shipment->error);
}