Skip to content
Clone

refactor(user): refresh profile me handler

zhenyi committed
parent 1a7999a commit 1570da2 Browse files

1 file changed

+4 −4

Modified lib/user/handler/profile/me.rs View lib/user/handler/profile/me.rs
@@ -1,5 +1,5 @@
1use axum::Json;
21use axum::extract::State;
2use export::data::AppResponseData;
33use jwt::extractor::AuthUser;
44
55use crate::error::UserResult;
@@ -12,14 +12,14 @@
1212 path = "/user/me",
1313 tag = "user",
1414 responses(
15 (status = 200, description = "Authenticated user profile (privileged view).", body = UserMe),
15 (status = 200, description = "Authenticated user profile (privileged view).", body = AppResponseData<UserMe>),
1616 ),
1717 security(("bearer_auth" = [])),
1818)]
1919pub(crate) async fn handler(
2020 State(svc): State<UserService>,
2121 AuthUser { claims }: AuthUser,
22) -> UserResult<Json<UserMe>> {
22) -> UserResult<AppResponseData<UserMe>> {
2323 let user = svc.get_user_me(claims.sub).await?;
24 Ok(Json(user))
24 Ok(AppResponseData::ok(user))
2525}
No newline at end of file