Misc v3 linear tasks (#767)

* v3_reroute 404 error

* hash change

* fixed issue with error conversion

* added new model confirmation tests
+ title name change

* renaming, fields

* owner; test changes

* clippy prepare

* fmt

* merge fixes

* clippy

* working merge

* revs

* merge fixes
This commit is contained in:
Wyatt Verchere
2023-12-01 19:15:00 -08:00
committed by GitHub
parent 2d92b08404
commit a70df067bc
119 changed files with 2897 additions and 1334 deletions

View File

@@ -62,7 +62,7 @@ pub async fn index_local(
GROUP BY version_id
)
SELECT m.id id, v.id version_id, m.title title, m.description description, m.downloads downloads, m.follows follows,
SELECT m.id id, v.id version_id, m.name name, m.description description, m.downloads downloads, m.follows follows,
m.icon_url icon_url, m.published published, m.approved approved, m.updated updated,
m.team_id team_id, m.license license, m.slug slug, m.status status_name, m.color color,
u.username username,
@@ -87,7 +87,7 @@ pub async fn index_local(
LEFT JOIN loaders_project_types_games lptg ON lptg.loader_id = lo.id AND lptg.project_type_id = pt.id
LEFT JOIN games g ON lptg.game_id = g.id
LEFT OUTER JOIN mods_gallery mg ON mg.mod_id = m.id
INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.role = $3 AND tm.accepted = TRUE
INNER JOIN team_members tm ON tm.team_id = m.team_id AND tm.is_owner = TRUE AND tm.accepted = TRUE
INNER JOIN users u ON tm.user_id = u.id
LEFT OUTER JOIN version_fields_json vf ON v.id = vf.version_id
LEFT OUTER JOIN loader_fields_json lf ON v.id = lf.version_id
@@ -97,7 +97,6 @@ pub async fn index_local(
",
&*crate::models::projects::VersionStatus::iterator().filter(|x| x.is_hidden()).map(|x| x.to_string()).collect::<Vec<String>>(),
&*crate::models::projects::ProjectStatus::iterator().filter(|x| x.is_searchable()).map(|x| x.to_string()).collect::<Vec<String>>(),
crate::models::teams::OWNER_ROLE,
)
.fetch_many(&pool)
.try_filter_map(|e| {
@@ -147,7 +146,7 @@ pub async fn index_local(
UploadSearchProject {
version_id: version_id.to_string(),
project_id: project_id.to_string(),
title: m.title,
name: m.name,
description: m.description,
categories,
follows: m.follows,

View File

@@ -185,7 +185,7 @@ const DEFAULT_DISPLAYED_ATTRIBUTES: &[&str] = &[
"project_types",
"slug",
"author",
"title",
"name",
"description",
"categories",
"display_categories",
@@ -201,7 +201,7 @@ const DEFAULT_DISPLAYED_ATTRIBUTES: &[&str] = &[
"color",
];
const DEFAULT_SEARCHABLE_ATTRIBUTES: &[&str] = &["title", "description", "author", "slug"];
const DEFAULT_SEARCHABLE_ATTRIBUTES: &[&str] = &["name", "description", "author", "slug"];
const DEFAULT_ATTRIBUTES_FOR_FACETING: &[&str] = &[
"categories",
@@ -210,7 +210,7 @@ const DEFAULT_ATTRIBUTES_FOR_FACETING: &[&str] = &[
"downloads",
"follows",
"author",
"title",
"name",
"date_created",
"created_timestamp",
"date_modified",

View File

@@ -79,7 +79,7 @@ pub struct UploadSearchProject {
pub project_types: Vec<String>,
pub slug: Option<String>,
pub author: String,
pub title: String,
pub name: String,
pub description: String,
pub categories: Vec<String>,
pub display_categories: Vec<String>,
@@ -119,7 +119,7 @@ pub struct ResultSearchProject {
pub project_types: Vec<String>,
pub slug: Option<String>,
pub author: String,
pub title: String,
pub name: String,
pub description: String,
pub categories: Vec<String>,
pub display_categories: Vec<String>,