Skip to content

Commit

Permalink
chore: add rarity sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
RakuJa committed Jul 7, 2024
1 parent 9406c09 commit 071477f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/db/shop_proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub async fn get_paginated_items(
ItemSortEnum::Name => a.core_item.name.cmp(&b.core_item.name),
ItemSortEnum::Level => a.core_item.level.cmp(&b.core_item.level),
ItemSortEnum::Type => a.core_item.item_type.cmp(&b.core_item.item_type),
ItemSortEnum::Rarity => a.core_item.rarity.cmp(&b.core_item.rarity),
};
match pagination
.shop_sort_data
Expand Down
2 changes: 2 additions & 0 deletions src/models/shop_structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ pub enum ItemSortEnum {
Level,
#[serde(alias = "type", alias = "TYPE")]
Type,
#[serde(alias = "rarity", alias = "RARITY")]
Rarity,
}

#[derive(Serialize, Deserialize, IntoParams, Validate, Eq, PartialEq, Hash, Default)]
Expand Down

0 comments on commit 071477f

Please sign in to comment.