Addd admin models to database

This commit is contained in:
IAmTomahawkx
2025-06-08 01:18:07 -07:00
committed by Angelo
parent af78ac0586
commit 6ecfd14b07
48 changed files with 1174 additions and 4 deletions

View File

@@ -84,6 +84,8 @@ impl IntoResponse for Error {
ErrorType::FileTypeNotAllowed => StatusCode::BAD_REQUEST,
ErrorType::ImageProcessingFailed => StatusCode::INTERNAL_SERVER_ERROR,
ErrorType::NoEmbedData => StatusCode::BAD_REQUEST,
ErrorType::ImATeaPot => StatusCode::IM_A_TEAPOT,
};
(status, Json(&self)).into_response()

View File

@@ -175,6 +175,9 @@ pub enum ErrorType {
FeatureDisabled {
feature: String,
},
// :)
ImATeaPot,
}
#[macro_export]

View File

@@ -90,6 +90,8 @@ impl<'r> Responder<'r, 'static> for Error {
ErrorType::FileTypeNotAllowed => Status::BadRequest,
ErrorType::ImageProcessingFailed => Status::InternalServerError,
ErrorType::NoEmbedData => Status::BadRequest,
ErrorType::ImATeaPot => Status::ImATeapot,
};
// Serialize the error data structure into JSON.