back end update
This commit is contained in:
@@ -15,4 +15,6 @@ if (isset($_GET["groupId"])) {
|
||||
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' => $groups->jsonSerialize()));
|
||||
echo json_encode(array('data' => $groups->jsonSerialize()));
|
||||
|
||||
|
||||
|
||||
@@ -10,11 +10,10 @@ if (isAdmin()) {
|
||||
$password = Password::firstWhere("group_id", $_POST['groupId']);
|
||||
if ($password) {
|
||||
$password->password = password_hash($_POST['newPassword'], PASSWORD_DEFAULT);
|
||||
echo $password;
|
||||
if (!$password->save()) {
|
||||
http_response_code(500);
|
||||
} else {
|
||||
http_response_code(201);
|
||||
http_response_code(200);
|
||||
}
|
||||
} else {
|
||||
http_response_code(400);
|
||||
|
||||
@@ -8,9 +8,6 @@ use Backend\Models\Password;
|
||||
use Backend\Models\GameJam;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
$groupName = "";
|
||||
$errors = array();
|
||||
|
||||
if (isset($_POST['regGroup'])) {
|
||||
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ if (isLogin()) {
|
||||
if (!$group->save()) {
|
||||
http_response_code(500);
|
||||
} else {
|
||||
http_response_code(201);
|
||||
http_response_code(200);
|
||||
}
|
||||
} else {
|
||||
http_response_code(400);
|
||||
|
||||
@@ -12,7 +12,7 @@ if (isLogin()) {
|
||||
if (!$password->save()) {
|
||||
http_response_code(500);
|
||||
} else {
|
||||
http_response_code(201);
|
||||
http_response_code(200);
|
||||
}
|
||||
} else {
|
||||
http_response_code(400);
|
||||
|
||||
Reference in New Issue
Block a user