From 421dd9f5bb6e70868d80ccc61fcd2dc7c7262b60 Mon Sep 17 00:00:00 2001 From: Fleeym <61891787+Fleeym@users.noreply.github.com> Date: Sat, 24 Feb 2024 16:19:43 +0200 Subject: [PATCH] remove 'validated' from mod payload --- src/types/models/mod_entity.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/types/models/mod_entity.rs b/src/types/models/mod_entity.rs index 0b96ad6..e2569ac 100644 --- a/src/types/models/mod_entity.rs +++ b/src/types/models/mod_entity.rs @@ -25,7 +25,6 @@ pub struct Mod { pub id: String, pub repository: Option, pub latest_version: String, - pub validated: bool, pub featured: bool, pub download_count: i32, pub developers: Vec, @@ -41,7 +40,6 @@ struct ModRecord { #[sqlx(default)] repository: Option, latest_version: String, - validated: bool, download_count: i32, featured: bool, _updated_at: DateTime, @@ -52,7 +50,6 @@ struct ModRecordGetOne { id: String, repository: Option, latest_version: String, - validated: bool, featured: bool, version_id: i32, mod_download_count: i32, @@ -104,7 +101,7 @@ impl Mod { } } let mut builder: QueryBuilder = 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 " ); @@ -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], @@ -297,7 +293,7 @@ impl Mod { let records: Vec = 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 @@ -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,