You've already forked AstralRinth
forked from didirus/AstralRinth
More APIv2 Fixes (#210)
* Refactor search to not spam the database with queries, new utility routes for V2 * Run prepare * More V2 Fixes * Run prepare + formatter
This commit is contained in:
@@ -13,7 +13,7 @@ pub async fn category_list(pool: web::Data<PgPool>) -> Result<HttpResponse, ApiE
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter(|x| &*x.project_type == "mod")
|
||||
.map(|x| x.project_type)
|
||||
.map(|x| x.category)
|
||||
.collect::<Vec<String>>();
|
||||
Ok(HttpResponse::Ok().json(results))
|
||||
}
|
||||
@@ -67,8 +67,7 @@ pub async fn loader_create(
|
||||
let name = loader.into_inner().0;
|
||||
let mut transaction = pool.begin().await?;
|
||||
|
||||
let project_types =
|
||||
ProjectType::get_many_id(&vec!["mod".to_string()], &mut *transaction).await?;
|
||||
let project_types = ProjectType::get_many_id(&["mod".to_string()], &mut *transaction).await?;
|
||||
|
||||
let _id = Loader::builder()
|
||||
.name(&name)?
|
||||
|
||||
Reference in New Issue
Block a user