forked from Wavyzz/dolibarr
api fixes
According to [RFC2616](https://www.rfc-editor.org/rfc/rfc2616#section-10.2), APIs should return 2xx status codes if the request was correct. The response should be status 200 with an empty result array.
This commit is contained in:
@@ -134,9 +134,7 @@ class Users extends DolibarrApi
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieve User list : '.$this->db->lasterror());
|
||||
}
|
||||
if (!count($obj_ret)) {
|
||||
throw new RestException(404, 'No User found');
|
||||
}
|
||||
|
||||
return $obj_ret;
|
||||
}
|
||||
|
||||
@@ -590,9 +588,7 @@ class Users extends DolibarrApi
|
||||
} else {
|
||||
throw new RestException(503, 'Error when retrieve Group list : '.$this->db->lasterror());
|
||||
}
|
||||
if (!count($obj_ret)) {
|
||||
throw new RestException(404, 'No Group found');
|
||||
}
|
||||
|
||||
return $obj_ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user