1
0

Testing bug fixes (#788)

* fixes

* adds tests- fixes failures

* changes

* moved transaction commits/caches around

* collections nullable

* merge fixes

* sqlx prepare

* revs

* lf fixes

* made changes back

* added collections update

---------

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Wyatt Verchere
2023-12-14 15:19:50 -07:00
committed by GitHub
parent 50e89ad98b
commit f939e59463
33 changed files with 494 additions and 112 deletions

View File

@@ -11,7 +11,7 @@ use labrinth::models::{
users::{User, UserId},
};
use rust_decimal::Decimal;
use serde::Deserialize;
use serde::{Deserialize, Serialize};
// Fields shared by every version of the API.
// No struct in here should have ANY field that
@@ -119,3 +119,23 @@ pub struct CommonNotification {
pub struct CommonNotificationAction {
pub action_route: (String, String),
}
#[derive(Serialize, Deserialize, Clone)]
#[serde(rename_all = "kebab-case")]
pub enum CommonItemType {
Project,
Version,
User,
Unknown,
}
impl CommonItemType {
pub fn as_str(&self) -> &'static str {
match self {
CommonItemType::Project => "project",
CommonItemType::Version => "version",
CommonItemType::User => "user",
CommonItemType::Unknown => "unknown",
}
}
}