refactor(user): refresh notifications recent_mentions handler
zhenyi committed
Modified lib/user/handler/notifications/recent_mentions.rs lib/user/handler/notifications/recent_mentions.rs +4 −4 View lib/user/handler/notifications/recent_mentions.rs
@@ -1,5 +1,5 @@
1use axum::Json;
21use axum::extract::{Query, State};
2use export::data::AppResponseData;
33use jwt::extractor::AuthUser;
44use serde::Deserialize;
55
@@ -23,7 +23,7 @@
2323 tag = "user",
2424 params(("limit" = Option<usize>, Query, description = "Maximum items (default 20).")),
2525 responses(
26 (status = 200, description = "Recent mentions for the caller.", body = Vec<RecentMentionView>),
26 (status = 200, description = "Recent mentions for the caller.", body = AppResponseData<Vec<RecentMentionView>>),
2727 ),
2828 security(("bearer_auth" = [])),
2929)]
@@ -31,6 +31,6 @@
3131 State(svc): State<UserService>,
3232 AuthUser { claims }: AuthUser,
3333 Query(q): Query<RecentQuery>,
34) -> UserResult<Json<Vec<RecentMentionView>>> {
35 Ok(Json(svc.list_recent_mentions(claims.sub, q.limit).await?))
34) -> UserResult<AppResponseData<Vec<RecentMentionView>>> {
35 Ok(AppResponseData::ok(svc.list_recent_mentions(claims.sub, q.limit).await?))
3636}
No newline at end of file