- Fixes API endpoint naming convention

- Generates/saves cron daemon token as soon as its executed
This commit is contained in:
Vlad
2016-07-07 14:00:07 -04:00
parent 1cd9f3eb67
commit 150364de3a
2 changed files with 5 additions and 4 deletions

View File

@ -34,13 +34,14 @@ class API {
$this->terminateRequest(self::API_RESPONSE_CODE_ERROR, __('Invalid API endpoint.'));
}
$this->callEndpoint(
self::ENDPOINT_NAMESPACE . $this->endpoint,
$this->endpoint,
$this->action,
$this->data
);
}
function callEndpoint($endpoint, $action, $data) {
$endpoint = self::ENDPOINT_NAMESPACE . ucfirst($endpoint);
if(!method_exists($endpoint, $action)) {
$this->terminateRequest(self::API_RESPONSE_CODE_ERROR, __('Invalid API action.'));
}