Skip to content
Clone

refactor(auth): refresh agreement list handler

zhenyi committed
parent ec4098f commit 39434e2 Browse files

1 file changed

+4 −4

Modified lib/auth/handler/agreement/list.rs View lib/auth/handler/agreement/list.rs
@@ -1,20 +1,20 @@
1use axum::Json;
21use axum::extract::State;
32
43use crate::config::AgreementDoc;
54use crate::error::AuthError;
65use crate::features::AuthService;
6use export::data::AppResponseData;
77
88#[utoipa::path(
99 get,
1010 path = "/auth/agreements",
1111 tag = "auth",
1212 responses(
13 (status = 200, description = "List of agreement documents (terms, privacy).", body = [AgreementDoc]),
13 (status = 200, description = "List of agreement documents (terms, privacy).", body = AppResponseData<Vec<AgreementDoc>>),
1414 ),
1515)]
1616pub(crate) async fn handler(
1717 State(svc): State<AuthService>,
18) -> Result<Json<Vec<AgreementDoc>>, AuthError> {
19 Ok(Json(svc.list_agreements()))
18) -> Result<AppResponseData<Vec<AgreementDoc>>, AuthError> {
19 Ok(AppResponseData::ok(svc.list_agreements()))
2020}