Skip to content

Commit

Permalink
bugfix: dedup word list before batch updating word status
Browse files Browse the repository at this point in the history
  • Loading branch information
nramos0 committed Sep 25, 2021
1 parent 6614e07 commit 8a55f67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/src/handlers/user/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ pub async fn batch_update_word_status(
}
};

let word_list: Vec<_> = json.words.iter().map(|word| &word[..]).collect();
let mut word_list: Vec<_> = json.words.iter().map(|word| &word[..]).collect();
word_list.sort_unstable();
word_list.dedup();

if let Err(err) = db::user::all_article_word_data::change_word_list_status(
&trans,
Expand Down

0 comments on commit 8a55f67

Please sign in to comment.