test
This commit is contained in:
@@ -13,7 +13,7 @@ if (isset($_GET['gameDataId'])) {
|
||||
$registrationIds = Registration::where("group_id", $_GET['groupId'])->pluck("game_data_id")->toArray();
|
||||
$openGameDataStream = GameData::whereIn("id", $registrationIds)->get();
|
||||
} elseif (isset($_GET['gameJamId'])) {
|
||||
$gameDataIds = Group::where("game_jam_id", $_GET['gameJamId'])->pluck("game_data_id")->toArray();
|
||||
$gameDataIds = Registration::where("game_jam_id", $_GET['gameJamId'])->pluck("game_data_id")->toArray();
|
||||
$openGameDataStream = GameData::whereIn("id", $gameDataIds)->get();
|
||||
} else {
|
||||
$openGameDataStream = GameData::all();
|
||||
|
||||
@@ -38,19 +38,30 @@ if (isLogin()) {
|
||||
|
||||
$gameData->game_name = $title;
|
||||
if (isset($gameData) && $gameFileError === 0) {
|
||||
unlink("../../Games/" . $gameData->game_link);
|
||||
$gameData->game_link = ZipFileHandler($gameFileName, $gameFileTmp);
|
||||
if(unlink("../../Games/" . $gameData->game_link)){
|
||||
$gameData->game_link = ZipFileHandler($gameFileName, $gameFileTmp);
|
||||
}else{
|
||||
http_response_code(500);
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
$gameData->description = $desc;
|
||||
if (isset($thumbnail) && $thumbnailFileError === 0) {
|
||||
unlink("../../../Frontend/images/" . $gameData->img);
|
||||
$gameData->img = imagesFileHandler($thumbnailFileName, $thumbnailFileTmp);
|
||||
|
||||
if(unlink("../../../Frontend/images/" . $gameData->img)){
|
||||
$gameData->img = imagesFileHandler($thumbnailFileName, $thumbnailFileTmp);
|
||||
}else{
|
||||
http_response_code(500);
|
||||
exit();
|
||||
}
|
||||
|
||||
}
|
||||
$gameData->is_web_Based = $isWebBased;
|
||||
if (!$gameData->save()) {
|
||||
http_response_code(500);
|
||||
} else {
|
||||
http_response_code(201);
|
||||
http_response_code(200);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -23,7 +23,7 @@ if (isLogin()) {
|
||||
echo json_encode(["message" => "gameJam not found"]);
|
||||
exit();
|
||||
}
|
||||
$registration = Registration::where('game_jam_id', $gameJam->id)->where("group_id", $group->id)->frist();
|
||||
$registration = Registration::where('game_jam_id', $gameJam->id)->where("group_id", $group->id)->first();
|
||||
if ($registration === null) {
|
||||
http_response_code(401);
|
||||
echo json_encode(["message" => "group not registered for that game jam"]);
|
||||
|
||||
Reference in New Issue
Block a user