Fix improperly set favorite_card_evolve
This commit is contained in:
parent
05ed74f3c6
commit
51a82a5161
@ -330,7 +330,7 @@ pub fn give_exp(amount: i32, user: &mut JsonValue) {
|
||||
}
|
||||
}
|
||||
|
||||
fn get_card(id: i64, user: &JsonValue) -> JsonValue {
|
||||
pub fn get_card(id: i64, user: &JsonValue) -> JsonValue {
|
||||
if id == 0 {
|
||||
return object!{};
|
||||
}
|
||||
|
@ -153,6 +153,7 @@ pub fn user_post(req: HttpRequest, body: String) -> HttpResponse {
|
||||
}
|
||||
if !body["favorite_master_card_id"].is_null() {
|
||||
user["user"]["favorite_master_card_id"] = body["favorite_master_card_id"].clone();
|
||||
user["user"]["favorite_card_evolve"] = if global::get_card(body["favorite_master_card_id"].as_i64().unwrap(), &user)["evolve"].is_empty() { 0 } else { 1 }.into();
|
||||
}
|
||||
if !body["guest_smile_master_card_id"].is_null() {
|
||||
user["user"]["guest_smile_master_card_id"] = body["guest_smile_master_card_id"].clone();
|
||||
|
Loading…
x
Reference in New Issue
Block a user