Skip to content

Commit

Permalink
remove 'validated' from mod payload
Browse files Browse the repository at this point in the history
  • Loading branch information
Fleeym committed Feb 24, 2024
1 parent 3454b09 commit 421dd9f
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/types/models/mod_entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pub struct Mod {
pub id: String,
pub repository: Option<String>,
pub latest_version: String,
pub validated: bool,
pub featured: bool,
pub download_count: i32,
pub developers: Vec<Developer>,
Expand All @@ -41,7 +40,6 @@ struct ModRecord {
#[sqlx(default)]
repository: Option<String>,
latest_version: String,
validated: bool,
download_count: i32,
featured: bool,
_updated_at: DateTime<Utc>,
Expand All @@ -52,7 +50,6 @@ struct ModRecordGetOne {
id: String,
repository: Option<String>,
latest_version: String,
validated: bool,
featured: bool,
version_id: i32,
mod_download_count: i32,
Expand Down Expand Up @@ -104,7 +101,7 @@ impl Mod {
}
}
let mut builder: QueryBuilder<Postgres> = QueryBuilder::new(
"SELECT * FROM (SELECT DISTINCT m.id, m.repository, m.latest_version, mv.validated, m.about, m.changelog, m.download_count, m.featured, m.updated_at as _updated_at FROM mods m
"SELECT * FROM (SELECT DISTINCT m.id, m.repository, m.latest_version, m.about, m.changelog, m.download_count, m.featured, m.updated_at as _updated_at FROM mods m
INNER JOIN mod_versions mv ON m.id = mv.mod_id
INNER JOIN mod_gd_versions mgv ON mgv.mod_id = mv.id "
);
Expand Down Expand Up @@ -279,7 +276,6 @@ impl Mod {
id: x.id.clone(),
repository: x.repository.clone(),
latest_version: x.latest_version.clone(),
validated: x.validated,
download_count: x.download_count,
featured: x.featured,
versions: vec![version],
Expand All @@ -297,7 +293,7 @@ impl Mod {
let records: Vec<ModRecordGetOne> = sqlx::query_as!(
ModRecordGetOne,
"SELECT
m.id, m.repository, m.latest_version, mv.validated, m.about, m.changelog, m.featured, m.download_count as mod_download_count,
m.id, m.repository, m.latest_version, m.about, m.changelog, m.featured, m.download_count as mod_download_count,
mv.id as version_id, mv.name, mv.description, mv.version, mv.download_link, mv.download_count as mod_version_download_count,
mv.hash, mv.geode, mv.early_load, mv.api, mv.mod_id
FROM mods m
Expand Down Expand Up @@ -351,7 +347,6 @@ impl Mod {
id: records[0].id.clone(),
repository: records[0].repository.clone(),
latest_version: records[0].latest_version.clone(),
validated: records[0].validated,
featured: records[0].featured,
download_count: records[0].mod_download_count,
versions,
Expand Down

0 comments on commit 421dd9f

Please sign in to comment.