get json update

This commit is contained in:
RundelhausCode 2021-03-22 15:27:08 +01:00
parent e26fa642ea
commit 4f4931f8dd
6 changed files with 5 additions and 6 deletions

View File

@ -17,4 +17,4 @@ if(isset($_GET['gameDataId'])){
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $openGameDataStream->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $openGameDataStream->jsonSerialize()));

View File

@ -13,7 +13,6 @@ header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo json_encode(array('data' => $dbValue->jsonSerialize()));
//var_dump(headers_list());

View File

@ -15,4 +15,4 @@ else{
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $groups->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $groups->jsonSerialize()));

View File

@ -5,7 +5,7 @@ require_once "../Group/Group.php";
if(isLogin()){
header('Content-Type: application/json;charset=UTF-8');
echo Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => Vote::where('group_id',groupViaToken($_SESSION['token'])->id)->get()->jsonSerialize()));
}else{
echo http_response_code(401);

View File

@ -25,7 +25,7 @@ if(isAdmin() && isset($_GET['gameJamId'])){
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $winningGroups->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $winningGroups->jsonSerialize()));
}else{

View File

@ -23,7 +23,7 @@ if (!isAdmin()){
header("Access-Control-Allow-Methods: GET");
header("Access-Control-Allow-Headers: X-Requested-With, Content-Type, Accept");
header('Content-Type: application/json;charset=UTF-8');
echo $find_all_keywords->pluck("key_word")->toJson(JSON_PRETTY_PRINT);
echo json_encode(array('data' => $find_all_keywords->jsonSerialize()));
}else{
echo http_response_code(400);
}