DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

ba90264f56e8101711b92852f27d3a6cd9f32be2 — Jonni Liljamo 1 year, 11 months ago 2ccd2b2
Fix API call for userinfop
2 files changed, 7 insertions(+), 3 deletions(-)

M sdbclient/src/api/user/mod.rs
M sdbclient/src/plugins/menu/accountlogin/mod.rs
M sdbclient/src/api/user/mod.rs => sdbclient/src/api/user/mod.rs +2 -2
@@ 96,11 96,11 @@ pub enum ResponseUserInfoP {
    Valid(ResultUserInfoP),
}

pub fn userinfop(api_address: String, token: String) -> ResponseUserInfoP {
pub fn userinfop(api_address: String, token: String, user_id: String) -> ResponseUserInfoP {
    let client = reqwest::blocking::Client::new();

    let resp = client
        .get(&format!("{}/user/register", api_address))
        .get(&format!("{}/user/_/{}", api_address, user_id))
        .header("Authorization", token)
        .send()
        .unwrap();

M sdbclient/src/plugins/menu/accountlogin/mod.rs => sdbclient/src/plugins/menu/accountlogin/mod.rs +5 -1
@@ 78,7 78,11 @@ fn start_login_call(
        let mut user_infop_response = None;
        match &token_response {
            ResponseToken::Valid(res) => {
                user_infop_response = Some(api::user::userinfop(api_address, res.token.clone()));
                user_infop_response = Some(api::user::userinfop(
                    api_address,
                    res.token.clone(),
                    res.id.clone(),
                ));
            }
            #[allow(unused_variables)]
            ResponseToken::Error { error } => {}