Skip to content
Clone

refactor(user): refresh notifications unread_count handler

zhenyi committed
parent 70f063b commit dbb51a7 Browse files

1 file changed

+4 −4

Modified lib/user/handler/notifications/unread_count.rs View lib/user/handler/notifications/unread_count.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;
@@ -11,13 +11,13 @@
1111 path = "/user/me/notifications/unread-count",
1212 tag = "user",
1313 responses(
14 (status = 200, description = "Number of unread notifications for the caller.", body = UnreadCountResp),
14 (status = 200, description = "Number of unread notifications for the caller.", body = AppResponseData<UnreadCountResp>),
1515 ),
1616 security(("bearer_auth" = [])),
1717)]
1818pub(crate) async fn handler(
1919 State(svc): State<UserService>,
2020 AuthUser { claims }: AuthUser,
21) -> UserResult<Json<UnreadCountResp>> {
22 Ok(Json(svc.unread_notifications_count(claims.sub).await?))
21) -> UserResult<AppResponseData<UnreadCountResp>> {
22 Ok(AppResponseData::ok(svc.unread_notifications_count(claims.sub).await?))
2323}
No newline at end of file