2
0
forked from Wavyzz/dolibarr

Fix travis and return of api that change status

This commit is contained in:
Laurent Destailleur
2018-01-05 02:01:57 +01:00
parent 940e9cb1a5
commit 1e438b7ebd
2 changed files with 52 additions and 49 deletions

View File

@@ -605,7 +605,18 @@ class Orders extends DolibarrApi
throw new RestException(400, $this->commande->error);
}
return $result;
$result = $this->commande->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Order not found');
}
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->commande->fetchObjectLinked();
return $this->_cleanObjectDatas($this->commande);
}
/**
@@ -640,7 +651,18 @@ class Orders extends DolibarrApi
throw new RestException(500, 'Error when closing Order: '.$this->commande->error);
}
return $result;
$result = $this->commande->fetch($id);
if( ! $result ) {
throw new RestException(404, 'Order not found');
}
if( ! DolibarrApi::_checkAccessToResource('commande',$this->commande->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
}
$this->commande->fetchObjectLinked();
return $this->_cleanObjectDatas($this->commande);
}
/**