Email change on user
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user