Commit 996a3142 authored by Zohten's avatar Zohten

every response is json

parent 375f05f2
...@@ -35,7 +35,8 @@ class UserController extends Controller ...@@ -35,7 +35,8 @@ class UserController extends Controller
} }
break; break;
} }
return Response::errorResponse("unsupported parameters or method in users"); $message = json_encode(["message" => "unsupported parameters or method in users"]);
return Response::errorResponse($message);
} }
/** /**
...@@ -83,10 +84,14 @@ class UserController extends Controller ...@@ -83,10 +84,14 @@ class UserController extends Controller
} }
if ($decodedJWT->data->id != $array['id']) { if ($decodedJWT->data->id != $array['id']) {
return Response::unauthorizedResponse("You don't have access to this account."); $message = json_encode(["message" => "You don't have access to this account."]);
return Response::unauthorizedResponse($message);
} }
User::updateUser($array); User::updateUser($array);
$response = Response::okResponse('User succesfully updated !');
$message = json_encode(["message" => 'User succesfully updated !']);
$response = Response::okResponse($message);
return $response; return $response;
} }
} }
Markdown is supported
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