mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-08 10:03:00 +01:00
Fix qodana
This commit is contained in:
@@ -60,7 +60,6 @@ class Receptions extends DolibarrApi
|
||||
*
|
||||
* @param int $id ID of reception
|
||||
* @return Object Object with cleaned properties
|
||||
*
|
||||
* @throws RestException
|
||||
*/
|
||||
public function get($id)
|
||||
@@ -386,14 +385,12 @@ class Receptions extends DolibarrApi
|
||||
/**
|
||||
* Delete a line to given reception
|
||||
*
|
||||
*
|
||||
* @param int $id Id of reception to update
|
||||
* @param int $lineid Id of line to delete
|
||||
* @return array
|
||||
*
|
||||
* @url DELETE {id}/lines/{lineid}
|
||||
*
|
||||
* @return int
|
||||
*
|
||||
* @throws RestException 401
|
||||
* @throws RestException 404
|
||||
*/
|
||||
@@ -412,23 +409,27 @@ class Receptions extends DolibarrApi
|
||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||
}
|
||||
|
||||
// TODO Check the lineid $lineid is a line of ojbect
|
||||
// TODO Check the lineid $lineid is a line of object
|
||||
|
||||
$updateRes = $this->reception->deleteline(DolibarrApiAccess::$user, $lineid);
|
||||
if ($updateRes > 0) {
|
||||
return $this->get($id);
|
||||
} else {
|
||||
if ($updateRes < 0) {
|
||||
throw new RestException(405, $this->reception->error);
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => array(
|
||||
'code' => 200,
|
||||
'message' => 'Line deleted'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update reception general fields (won't touch lines of reception)
|
||||
*
|
||||
* @param int $id Id of reception to update
|
||||
* @param array $request_data Datas
|
||||
*
|
||||
* @return int
|
||||
* @param int $id Id of reception to update
|
||||
* @param array $request_data Datas
|
||||
* @return Object Object with cleaned properties
|
||||
*/
|
||||
public function put($id, $request_data = null)
|
||||
{
|
||||
@@ -462,7 +463,6 @@ class Receptions extends DolibarrApi
|
||||
* Delete reception
|
||||
*
|
||||
* @param int $id Reception ID
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function delete($id)
|
||||
|
||||
Reference in New Issue
Block a user