mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Fix changing user deck characters
This commit is contained in:
parent
ad9f1afb3a
commit
9b9afecb28
1 changed files with 4 additions and 1 deletions
|
@ -13,7 +13,7 @@ pub fn deck(req: HttpRequest, body: String) -> HttpResponse {
|
||||||
|
|
||||||
for (i, data) in user["deck_list"].members().enumerate() {
|
for (i, data) in user["deck_list"].members().enumerate() {
|
||||||
if data["slot"].to_string() == body["slot"].to_string() {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,6 +198,9 @@ pub fn user_post(req: HttpRequest, body: String) -> HttpResponse {
|
||||||
if !body["profile_settings"].is_null() {
|
if !body["profile_settings"].is_null() {
|
||||||
user["user"]["profile_settings"] = body["profile_settings"].clone();
|
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());
|
userdata::save_acc(&key, user.clone());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue