Skip to content
Snippets Groups Projects
Commit 8d86b8b3 authored by Xebax's avatar Xebax
Browse files

REST API: fix the definition of /orders/{id}/validate.

parent ce6d7046
No related branches found
No related tags found
No related merge requests found
......@@ -441,13 +441,17 @@ class Orders extends DolibarrApi
* @param int $id Order ID
* @param int $idwarehouse Warehouse ID
*
* @url GET order/{id}/validate
* @url POST order/{id}/validate
* @url POST {id}/validate
*
* @return array
* TODO keep only one of the two verbs above (and fix the URL: {id}/validate)
* FIXME An error 403 is returned if the request has an empty body.
* Error message: "Forbidden: Content type `text/plain` is not supported."
* Workaround: send this in the body
* {
* "idwarehouse": 0
* }
*/
function validOrder($id, $idwarehouse=0)
function validate($id, $idwarehouse=0)
{
if(! DolibarrApiAccess::$user->rights->commande->creer) {
throw new RestException(401);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment