refactor(user): refresh ssh_keys list_keys handler
zhenyi committed
Modified lib/user/handler/security/ssh_keys/list_keys.rs lib/user/handler/security/ssh_keys/list_keys.rs +4 −4 View lib/user/handler/security/ssh_keys/list_keys.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/ssh-keys",
1212 tag = "user",
1313 responses(
14 (status = 200, description = "List SSH keys for the caller.", body = Vec<SshKeyView>),
14 (status = 200, description = "List SSH keys for the caller.", body = AppResponseData<Vec<SshKeyView>>),
1515 ),
1616 security(("bearer_auth" = [])),
1717)]
1818pub(crate) async fn handler(
1919 State(svc): State<UserService>,
2020 AuthUser { claims }: AuthUser,
21) -> UserResult<Json<Vec<SshKeyView>>> {
22 Ok(Json(svc.list_ssh_keys(claims.sub).await?))
21) -> UserResult<AppResponseData<Vec<SshKeyView>>> {
22 Ok(AppResponseData::ok(svc.list_ssh_keys(claims.sub).await?))
2323}
No newline at end of file