* plugins; datapacks

* merge fixes/changes

---------

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Wyatt Verchere
2023-11-25 17:11:38 -08:00
committed by GitHub
parent 172b93d07f
commit bad350e49b
9 changed files with 163 additions and 90 deletions

View File

@@ -3,8 +3,10 @@ use actix_web::{
test::{self, TestRequest},
};
use async_trait::async_trait;
use labrinth::database::models::loader_fields::LoaderFieldEnumValue;
use labrinth::routes::v3::tags::GameData;
use labrinth::{
database::models::loader_fields::LoaderFieldEnumValue, routes::v3::tags::LoaderData,
};
use crate::common::{
api_common::{
@@ -48,6 +50,12 @@ impl ApiTags for ApiV3 {
}
impl ApiV3 {
pub async fn get_loaders_deserialized(&self) -> Vec<LoaderData> {
let resp = self.get_loaders().await;
assert_eq!(resp.status(), 200);
test::read_body_json(resp).await
}
pub async fn get_loader_field_variants(&self, loader_field: &str) -> ServiceResponse {
let req = TestRequest::get()
.uri(&format!("/v3/loader_field?loader_field={}", loader_field))