diff options
Diffstat (limited to 'server/src/main.rs')
| -rw-r--r-- | server/src/main.rs | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/server/src/main.rs b/server/src/main.rs index f07c372..9bdfeaf 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -14,6 +14,7 @@ use std::path::PathBuf; use utoipa::OpenApi; use utoipa_swagger_ui::SwaggerUi; +use eyeballs_api::api_model; use eyeballs_common::fs_utils; use eyeballs_common::git; use eyeballs_common::git_socket; @@ -21,7 +22,6 @@ use eyeballs_common::git_socket; #[cfg(test)] mod tests; -mod api_model; mod auth; mod authorized_keys; mod db_utils; @@ -58,29 +58,6 @@ struct Db(sqlx::MySqlPool); )] pub struct MainApi; -impl TryFrom<u8> for api_model::UserReviewRole { - type Error = &'static str; - - fn try_from(value: u8) -> Result<Self, Self::Error> { - match value { - 0 => Ok(api_model::UserReviewRole::None), - 1 => Ok(api_model::UserReviewRole::Reviewer), - 2 => Ok(api_model::UserReviewRole::Watcher), - _ => Err("Invalid role"), - } - } -} - -impl From<api_model::UserReviewRole> for u8 { - fn from(value: api_model::UserReviewRole) -> u8 { - match value { - api_model::UserReviewRole::None => 0, - api_model::UserReviewRole::Reviewer => 1, - api_model::UserReviewRole::Watcher => 2, - } - } -} - #[utoipa::path( responses( (status = 200, description = "Get all projects", body = api_model::Projects), |
