From 9b9afecb28ee911c5ef09bbd4d79c1edd775787a Mon Sep 17 00:00:00 2001 From: Ethan O'Brien <77750390+ethanaobrien@users.noreply.github.com> Date: Sat, 13 Apr 2024 22:55:54 -0500 Subject: [PATCH] Fix changing user deck characters --- src/router/user.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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());