chore: migrate bots create route

This commit is contained in:
Paul Makles
2023-08-05 11:24:02 +01:00
parent 42f977f536
commit c9011ac692
16 changed files with 272 additions and 35 deletions

View File

@@ -43,6 +43,7 @@ pub enum ErrorType {
// ? User related errors
UsernameTaken,
InvalidUsername,
DiscriminatorChangeRatelimited,
UnknownUser,
AlreadyFriends,
AlreadySentRequest,

View File

@@ -19,6 +19,7 @@ impl<'r> Responder<'r, 'static> for Error {
ErrorType::UnknownUser => Status::NotFound,
ErrorType::InvalidUsername => Status::BadRequest,
ErrorType::UsernameTaken => Status::Conflict,
ErrorType::DiscriminatorChangeRatelimited => Status::TooManyRequests,
ErrorType::AlreadyFriends => Status::Conflict,
ErrorType::AlreadySentRequest => Status::Conflict,
ErrorType::Blocked => Status::Conflict,