diff --git a/src/router/user.rs b/src/router/user.rs index b646d47..c64d46c 100644 --- a/src/router/user.rs +++ b/src/router/user.rs @@ -13,7 +13,7 @@ pub fn deck(req: HttpRequest, body: String) -> HttpResponse { for (i, data) in user["deck_list"].members().enumerate() { if data["slot"].to_string() == body["slot"].to_string() { - user["deck_list"][i] = body["main_card_ids"].clone(); + user["deck_list"][i]["main_card_ids"] = body["main_card_ids"].clone(); break; } } @@ -198,6 +198,9 @@ pub fn user_post(req: HttpRequest, body: String) -> HttpResponse { if !body["profile_settings"].is_null() { user["user"]["profile_settings"] = body["profile_settings"].clone(); } + if !body["main_deck_slot"].is_null() { + user["user"]["main_deck_slot"] = body["main_deck_slot"].clone(); + } userdata::save_acc(&key, user.clone());