back end update

This commit is contained in:
2021-04-26 08:21:51 +02:00
parent a59fcdca30
commit 5213c33f2a
10 changed files with 30 additions and 12 deletions
+1 -2
View File
@@ -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);