feat: Working server/comment routes
This commit is contained in:
@@ -34,8 +34,10 @@ impl IntoResponse for Error {
|
||||
ErrorType::GroupTooLarge { .. } => StatusCode::FORBIDDEN,
|
||||
ErrorType::AlreadyInGroup => StatusCode::CONFLICT,
|
||||
ErrorType::NotInGroup => StatusCode::NOT_FOUND,
|
||||
ErrorType::NotAMember => StatusCode::BAD_REQUEST,
|
||||
ErrorType::AlreadyPinned => StatusCode::BAD_REQUEST,
|
||||
ErrorType::NotPinned => StatusCode::BAD_REQUEST,
|
||||
ErrorType::InviteExists => StatusCode::BAD_REQUEST,
|
||||
|
||||
ErrorType::UnknownServer => StatusCode::NOT_FOUND,
|
||||
ErrorType::InvalidRole => StatusCode::NOT_FOUND,
|
||||
|
||||
@@ -101,11 +101,13 @@ pub enum ErrorType {
|
||||
NotInGroup,
|
||||
AlreadyPinned,
|
||||
NotPinned,
|
||||
InviteExists,
|
||||
|
||||
// ? Server related errors
|
||||
UnknownServer,
|
||||
InvalidRole,
|
||||
Banned,
|
||||
NotAMember,
|
||||
TooManyServers {
|
||||
max: usize,
|
||||
},
|
||||
|
||||
@@ -40,9 +40,11 @@ impl<'r> Responder<'r, 'static> for Error {
|
||||
ErrorType::GroupTooLarge { .. } => Status::Forbidden,
|
||||
ErrorType::AlreadyInGroup => Status::Conflict,
|
||||
ErrorType::NotInGroup => Status::NotFound,
|
||||
ErrorType::NotAMember => Status::BadRequest,
|
||||
ErrorType::AlreadyPinned => Status::BadRequest,
|
||||
ErrorType::NotPinned => Status::BadRequest,
|
||||
ErrorType::InvalidFlagValue => Status::BadRequest,
|
||||
ErrorType::InviteExists => Status::BadRequest,
|
||||
|
||||
ErrorType::UnknownServer => Status::NotFound,
|
||||
ErrorType::InvalidRole => Status::NotFound,
|
||||
|
||||
Reference in New Issue
Block a user