Fix checks

This commit is contained in:
Jai A 2024-10-18 16:23:32 -07:00
parent 8dd955563e
commit b8ad22a6fb
No known key found for this signature in database
GPG Key ID: 9A9F9B7250E9883C
5 changed files with 22 additions and 3 deletions

View File

@ -62,6 +62,8 @@ jobs:
- name: Build
run: pnpm build
env:
SQLX_OFFLINE: true
- name: Lint
run: pnpm lint

View File

@ -32,6 +32,7 @@ use serde::Deserialize;
// as the environment generator for both uses common fields.
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonProject {
// For example, for CommonProject, we do not include:
// - game_versions (v2 only)
@ -62,6 +63,7 @@ pub struct CommonProject {
pub monetization_status: MonetizationStatus,
}
#[derive(Deserialize, Clone)]
#[allow(dead_code)]
pub struct CommonVersion {
pub id: VersionId,
pub loaders: Vec<String>,
@ -81,6 +83,7 @@ pub struct CommonVersion {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonLoaderData {
pub icon: String,
pub name: String,
@ -88,6 +91,7 @@ pub struct CommonLoaderData {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonCategoryData {
pub icon: String,
pub name: String,
@ -97,6 +101,7 @@ pub struct CommonCategoryData {
/// A member of a team
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonTeamMember {
pub team_id: TeamId,
pub user: User,
@ -110,6 +115,7 @@ pub struct CommonTeamMember {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonNotification {
pub id: NotificationId,
pub user_id: UserId,
@ -122,6 +128,7 @@ pub struct CommonNotification {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonNotificationAction {
pub action_route: (String, String),
}
@ -147,6 +154,7 @@ impl CommonItemType {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonReport {
pub id: ReportId,
pub report_type: String,
@ -168,6 +176,7 @@ pub enum LegacyItemType {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonThread {
pub id: ThreadId,
#[serde(rename = "type")]
@ -179,6 +188,7 @@ pub struct CommonThread {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonThreadMessage {
pub id: ThreadMessageId,
pub author_id: Option<UserId>,
@ -187,6 +197,7 @@ pub struct CommonThreadMessage {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub enum CommonMessageBody {
Text {
body: String,
@ -206,6 +217,7 @@ pub enum CommonMessageBody {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub enum CommonThreadType {
Report,
Project,
@ -213,6 +225,7 @@ pub enum CommonThreadType {
}
#[derive(Deserialize)]
#[allow(dead_code)]
pub struct CommonUser {
pub id: UserId,
pub username: String,

View File

@ -5,18 +5,21 @@ use labrinth::util::actix::MultipartSegment;
use crate::common::dummy_data::TestFile;
#[allow(dead_code)]
pub struct ProjectCreationRequestData {
pub slug: String,
pub jar: Option<TestFile>,
pub segment_data: Vec<MultipartSegment>,
}
#[allow(dead_code)]
pub struct VersionCreationRequestData {
pub version: String,
pub jar: Option<TestFile>,
pub segment_data: Vec<MultipartSegment>,
}
#[allow(dead_code)]
pub struct ImageData {
pub filename: String,
pub extension: String,

View File

@ -18,7 +18,7 @@ use labrinth::models::teams::ProjectPermissions;
use labrinth::util::actix::{MultipartSegment, MultipartSegmentData};
use serde_json::json;
use crate::common::api_common::models::{CommonItemType, CommonProject};
use crate::common::api_common::models::CommonProject;
use crate::common::api_common::request_data::ProjectCreationRequestData;
use crate::common::api_common::{ApiProject, ApiTeams, ApiVersion};
use crate::common::dummy_data::{
@ -1343,7 +1343,7 @@ async fn projects_various_visibility() {
for (pat, expected_count) in visible_pat_pairs {
let projects = env
.api
.get_projects(&[&alpha_project_id, &beta_project_id], pat)
.get_projects(&[alpha_project_id, beta_project_id], pat)
.await;
let projects: Vec<CommonProject> =
test::read_body_json(projects).await;

View File

@ -15,7 +15,8 @@
"VERCEL_*",
"CF_PAGES_*",
"HEROKU_APP_NAME",
"STRIPE_PUBLISHABLE_KEY"
"STRIPE_PUBLISHABLE_KEY",
"SQLX_OFFLINE"
]
},
"lint": {},