test
This commit is contained in:
@@ -7,20 +7,20 @@ use Backend\Models\Registration;
|
||||
use Backend\Models\Group;
|
||||
use Backend\Models\KeyWord;
|
||||
|
||||
session_start();
|
||||
|
||||
if (isLogin()) {
|
||||
if (isset($_POST['submitKeyWord'])) {
|
||||
//Find the group
|
||||
$group = groupViaToken($_SESSION['token']);
|
||||
|
||||
if($gameJam = GameJam::find($_POST["gameJamId"]) === null){
|
||||
if(!$gameJam = GameJam::find($_POST['gameJamId'])){
|
||||
http_response_code(400);
|
||||
echo json_encode(["message" => "gameJam not found"]);
|
||||
exit();
|
||||
}
|
||||
$registration = Registration::where('game_jam_id', $gameJam->id)->where("group_id", $group->id)->frist();
|
||||
if ($registration === null) {
|
||||
//var_dump($gameJam);
|
||||
|
||||
$registration = Registration::where('game_jam_id', $gameJam->id)->where("group_id", $group->id)->first();
|
||||
if (!$registration) {
|
||||
http_response_code(401);
|
||||
echo json_encode(["message" => "group not registered for that game jam"]);
|
||||
exit();
|
||||
@@ -33,7 +33,7 @@ if (isLogin()) {
|
||||
$keyword = new KeyWord();
|
||||
|
||||
//Take the keyWord the user typed and set it equal to the keyword valuable
|
||||
$keyword->key_word = $_POST['key_word'];
|
||||
$keyword->key_word = $_POST['keyWord'];
|
||||
|
||||
//Make foreign key from the groups table to the keyWords table
|
||||
$keyword->registration()->associate($registration);
|
||||
|
||||
Reference in New Issue
Block a user