Email change on user

This commit is contained in:
2024-07-27 02:52:24 +02:00
parent 683b6020b7
commit 12f7176467
6 changed files with 86 additions and 25 deletions
+4 -4
View File
@@ -42,12 +42,12 @@ class Users extends Api
// Fetch all inputs.
$username = Input::patch("username");
$password = Input::patch("password");
$image = Input::file("image");
$email = Input::patch("email");
// Try and update user.
// Throw errors according to situation.
try {
Response::json(User::getByID($id)->update($username, $password, $image));
Response::json(User::getByID($id)->update($username, $password, $email));
} catch (Exception $err) {
switch ($err->getMessage()) {
case "NotFound":
@@ -65,12 +65,12 @@ class Users extends Api
$token = Request::token();
$username = Input::patch("username");
$password = Input::patch("password");
$image = Input::file("image");
$email = Input::patch("email");
// Try and update user.
// Throw errors according to situation.
try {
Response::json(User::getByToken($token)->update($username, $password, $image));
Response::json(User::getByToken($token)->update($username, $password, $email));
} catch (Exception $err) {
switch ($err->getMessage()) {
case "NotFound":