Skip to content
Snippets Groups Projects
Commit 9cd5dae3 authored by Jeffry's avatar Jeffry
Browse files

Added profile checking for logged in username

parent eb522bd9
Branches
No related merge requests found
......@@ -15,8 +15,14 @@ class BiodataController extends BaseController {
if (isset($username)) {
$model_biodata = new Model\BiodataModel();
$biodata = $model_biodata->findByID($username);
$this->setResponse(200, "Success");
return $biodata->asArray();
if (isset($biodata)) {
$this->setResponse(200, "Success");
return $biodata->asArray();
}
else {
$this->setResponse(500, "No biodata for $username");
return;
}
}
else {
$this->setResponse(401, "Please log in first!");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment