Fixed issue where all knives were not listed
This commit is contained in:
@@ -286,10 +286,12 @@ pub async fn list_paint_index(
|
||||
min_float: 0.0,
|
||||
max_float: 0.0
|
||||
}).collect()
|
||||
} else if gloves {
|
||||
query_as!(PaintIndexInfo, "SELECT w.name, s.paint_index, s.display, r.color, s.min_float, s.max_float FROM skins s JOIN rarity r ON r.id = s.rarity JOIN weapons w ON w.id = s.weapon WHERE w.category='Gloves'").fetch_all(&pool).await?
|
||||
} else {
|
||||
query_as!(PaintIndexInfo, "SELECT w.name, s.paint_index, s.display, r.color, s.min_float, s.max_float FROM skins s JOIN rarity r ON r.id = s.rarity JOIN weapons w ON w.id = s.weapon WHERE s.weapon=$1", paint_query.weapon).fetch_all(&pool).await?
|
||||
let category = query!("SELECT w.category FROM weapons w WHERE w.id=$1", paint_query.weapon).fetch_one(&pool).await?;
|
||||
match category.category.as_str() {
|
||||
"Knives" | "Gloves" => query_as!(PaintIndexInfo, "SELECT w.name, s.paint_index, s.display, r.color, s.min_float, s.max_float FROM skins s JOIN rarity r ON r.id = s.rarity JOIN weapons w ON w.id = s.weapon WHERE w.category=$1", category.category).fetch_all(&pool).await?,
|
||||
_ => query_as!(PaintIndexInfo, "SELECT w.name, s.paint_index, s.display, r.color, s.min_float, s.max_float FROM skins s JOIN rarity r ON r.id = s.rarity JOIN weapons w ON w.id = s.weapon WHERE w.id=$1", paint_query.weapon).fetch_all(&pool).await?
|
||||
}
|
||||
};
|
||||
Ok(Json(paints))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user