You've already forked AstralRinth
* search patch for accurate loader/gv filtering * backup * basic search test * finished test * incomplete commit; backing up * Working multipat reroute backup * working rough draft v3 * most tests passing * works * search v2 conversion * added some tags.rs v2 conversions * Worked through warnings, unwraps, prints * refactors * new search test * version files changes fixes * redesign to revs * removed old caches * removed games * fmt clippy * merge conflicts * fmt, prepare * moved v2 routes over to v3 * fixes; tests passing * project type changes * moved files over * fmt, clippy, prepare, etc * loaders to loader_fields, added tests * fmt, clippy, prepare * fixed sorting bug * reversed back- wrong order for consistency * fmt; clippy; prepare --------- Co-authored-by: Jai A <jaiagr+gpg@pm.me>
34 lines
789 B
Rust
34 lines
789 B
Rust
#![allow(dead_code)]
|
|
|
|
use super::environment::LocalService;
|
|
use actix_web::dev::ServiceResponse;
|
|
use std::rc::Rc;
|
|
|
|
pub mod organization;
|
|
pub mod project;
|
|
pub mod tags;
|
|
pub mod team;
|
|
pub mod version;
|
|
|
|
#[derive(Clone)]
|
|
pub struct ApiV2 {
|
|
pub test_app: Rc<dyn LocalService>,
|
|
}
|
|
|
|
impl ApiV2 {
|
|
pub async fn call(&self, req: actix_http::Request) -> ServiceResponse {
|
|
self.test_app.call(req).await.unwrap()
|
|
}
|
|
|
|
pub async fn reset_search_index(&self) -> ServiceResponse {
|
|
let req = actix_web::test::TestRequest::post()
|
|
.uri("/v2/admin/_force_reindex")
|
|
.append_header((
|
|
"Modrinth-Admin",
|
|
dotenvy::var("LABRINTH_ADMIN_KEY").unwrap(),
|
|
))
|
|
.to_request();
|
|
self.call(req).await
|
|
}
|
|
}
|