Skip to content
Clone

refactor(issues): refresh issue_attachment list handler

zhenyi committed
parent 4b76281 commit 560bb6e Browse files

1 file changed

+3 −3

Modified lib/issues/handler/issue_attachment/list.rs View lib/issues/handler/issue_attachment/list.rs
@@ -1,5 +1,5 @@
1use axum::Json;
21use axum::extract::{Path, Query, State};
2use export::data::AppResponseData;
33use jwt::extractor::AuthUser;
44use uuid::Uuid;
55
@@ -20,13 +20,13 @@
2020 AuthUser { claims }: AuthUser,
2121 Path((channel_id, owner_type, owner_id)): Path<(Uuid, String, Uuid)>,
2222 Query(q): Query<ListAttachmentQuery>,
23) -> IssueResult<Json<serde_json::Value>> {
23) -> IssueResult<AppResponseData<serde_json::Value>> {
2424 let owner_type = owner_type_from_str(&owner_type)
2525 .ok_or_else(|| IssueError::BadRequest(format!("invalid owner_type {owner_type}")))?;
2626 let page = svc
2727 .list_attachments(claims.sub, channel_id, owner_type, owner_id, q)
2828 .await?;
29 Ok(Json(serde_json::json!({
29 Ok(AppResponseData::ok(serde_json::json!({
3030 "items": page.items,
3131 "total": page.total,
3232 })))