Update api_contracts.class.php

This commit is contained in:
Frédéric FRANCE 2020-10-22 21:51:42 +02:00 committed by GitHub
parent a5e2ab2822
commit 12dc82c340
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -438,7 +438,7 @@ class Contracts extends DolibarrApi
* *
* @url DELETE {id}/lines/{lineid} * @url DELETE {id}/lines/{lineid}
* *
* @return int * @return array|mixed
* *
* @throws RestException 401 * @throws RestException 401
* @throws RestException 404 * @throws RestException 404
@ -474,7 +474,7 @@ class Contracts extends DolibarrApi
* @param int $id Id of contract to update * @param int $id Id of contract to update
* @param array $request_data Datas * @param array $request_data Datas
* *
* @return int * @return array|mixed
*/ */
public function put($id, $request_data = null) public function put($id, $request_data = null)
{ {
@ -495,8 +495,7 @@ class Contracts extends DolibarrApi
$this->contract->$field = $value; $this->contract->$field = $value;
} }
if ($this->contract->update(DolibarrApiAccess::$user) > 0) if ($this->contract->update(DolibarrApiAccess::$user) > 0) {
{
return $this->get($id); return $this->get($id);
} else { } else {
throw new RestException(500, $this->contract->error); throw new RestException(500, $this->contract->error);