Skip to content
Clone

refactor(user): refresh notifications mark_all_read handler

zhenyi committed
parent c4c83af commit 27ba42c Browse files

1 file changed

+4 −4

Modified lib/user/handler/notifications/mark_all_read.rs View lib/user/handler/notifications/mark_all_read.rs
@@ -1,5 +1,5 @@
1use axum::Json;
21use axum::extract::State;
2use export::data::AppResponseData;
33use jwt::extractor::AuthUser;
44use serde::Serialize;
55
@@ -16,14 +16,14 @@
1616 path = "/user/me/notifications/mark-all-read",
1717 tag = "user",
1818 responses(
19 (status = 200, description = "All notifications marked as read.", body = MarkAllReadResp),
19 (status = 200, description = "All notifications marked as read.", body = AppResponseData<MarkAllReadResp>),
2020 ),
2121 security(("bearer_auth" = [])),
2222)]
2323pub(crate) async fn handler(
2424 State(svc): State<UserService>,
2525 AuthUser { claims }: AuthUser,
26) -> UserResult<Json<MarkAllReadResp>> {
26) -> UserResult<AppResponseData<MarkAllReadResp>> {
2727 let marked = svc.mark_all_notifications_read(claims.sub).await?;
28 Ok(Json(MarkAllReadResp { marked }))
28 Ok(AppResponseData::ok(MarkAllReadResp { marked }))
2929}
No newline at end of file