/// update password/email, empty string for fields you dont want to update
///
/// [example cms page](https://training.olinfo.it/#/user/Gemmady/edit)
update password/email, empty string for fields you dont want to update
[example cms page]
update password / email empty string for fields you dont want to update [ example cms page ]
pub fn user_update(&self, email: &str, password: &str, old_password: &str) -> Result<(), u8> {
        match self.client.post("https://training.olinfo.it/api/user").json(&serde_json::json!({"action":"update","email":email,"old_password":old_password,"password":password})).send() {
            Ok(mut response) => {
                #[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
                struct Resp {
                    success: u8
                }
                match response.json::<Resp>() {
                    Ok(resp) => {
                        match resp.success {
                            1 => Ok(()),
                            _ => Err(3)
                        }
                    },
                    _ => Err(2)
                }
            },
            _ => {
                Err(1)
            }
        }
    }
pub fn user_update ( & self , email : & str , password : & str , old_password : & str ) -> Result < ( ) , u8 > { match self . client . post ( " " ) . json ( & serde_json :: json ! ( { " " " " " " email " " old_password " " password } ) ) . send ( ) { Ok ( mut response ) => { # [ derive ( serde Serialize serde Deserialize Debug Clone ) ] struct Resp { success : u8 } match response . json :: < Resp > ( ) { Ok ( resp ) => { match resp . success { 1 => Ok ( ( ) ) , _ => Err ( 3 ) } } , _ => Err ( 2 ) } } , _ => { Err ( 1 ) } } }
update password/email, empty string for fields you dont want to update
[example cms page](https://training.olinfo.it/#/user/Gemmady/edit)
update password / email empty string for fields you dont want to update [ example cms page ] ( https : // training . olinfo . it / # / user / Gemmady / edit )
&self
email
&str
password
&str
old_password
&str