summaryrefslogtreecommitdiffstats
path: root/src/api/users.rs
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-04-11 23:43:55 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-04-11 23:57:02 -0500
commitb26d3c09eaec958c75931cc126367d4124cbffad (patch)
tree04eb1039b1f4646d84356a3b1779b24701609417 /src/api/users.rs
parenta20f3667a88affa0498e564cea17e9e795162bb8 (diff)
refactor: improve error handling and layout
Diffstat (limited to 'src/api/users.rs')
-rw-r--r--src/api/users.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/api/users.rs b/src/api/users.rs
index 3eb7e89..7a9bb6e 100644
--- a/src/api/users.rs
+++ b/src/api/users.rs
@@ -11,7 +11,9 @@ use sqlx::FromRow;
use time::OffsetDateTime;
use uuid::Uuid;
-use crate::{auth::AccessClaims, state::AppState, Error};
+use crate::{auth::AccessClaims, state::AppState};
+
+use super::error::Error;
pub fn router() -> Resource<AppState> {
Resource::named("users").create(create).show(show)
@@ -222,7 +224,7 @@ mod tests {
let response = router.oneshot(request).await?;
- assert_eq!(StatusCode::UNAUTHORIZED, response.status());
+ assert_eq!(StatusCode::UNPROCESSABLE_ENTITY, response.status());
Ok(())
}