Created
August 15, 2017 16:28
-
-
Save simistern/063d3e1460723f36f74676101ee33781 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function index($id = false) | |
{ | |
switch ($this->request_method) { | |
case API_METHOD_GET: | |
return $this->get_all_user_vehicles(); | |
break; | |
case API_METHOD_POST: | |
return $this->create_user_vehicle(); | |
break; | |
default: | |
# code... | |
break; | |
} | |
$this->_set_status_message(HTTP_STATUS_NOT_FOUND, 'Not found'); | |
} | |
public function create_user_vehicle() | |
{ | |
error_log("----------------Inside simons api----------------"); | |
$user_vehicle = false; | |
$make_id3 = $this->input->get_post('*'); | |
$make_id4 = $this->input->get_post('service_request'); | |
error_log(print_r($make_id4,true)); | |
error_log(print_r($make_id3,true)); | |
error_log(print_r($_POST, true)); | |
error_log(print_r($_POST['service_request'], true)); | |
error_log(print_r($_POST['*'], true)); | |
error_log(print_r($_POST['body'], true)); | |
$this->_set_status_message(300, 'Vehicle was successfully addedsd'); | |
$this->_return_api([ | |
'user_vehicle' => $user_vehicle | |
]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment