mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-21 22:27:08 +00:00
Changing list_logins to return a ListLoginsResponse object. (#4888)
- Fixes #4873
This commit is contained in:
parent
c8ad0f2d09
commit
ef49a0eb8d
|
@ -1,5 +1,5 @@
|
|||
use actix_web::web::{Data, Json};
|
||||
use lemmy_api_common::context::LemmyContext;
|
||||
use lemmy_api_common::{context::LemmyContext, person::ListLoginsResponse};
|
||||
use lemmy_db_schema::source::login_token::LoginToken;
|
||||
use lemmy_db_views::structs::LocalUserView;
|
||||
use lemmy_utils::error::LemmyResult;
|
||||
|
@ -7,8 +7,8 @@ use lemmy_utils::error::LemmyResult;
|
|||
pub async fn list_logins(
|
||||
context: Data<LemmyContext>,
|
||||
local_user_view: LocalUserView,
|
||||
) -> LemmyResult<Json<Vec<LoginToken>>> {
|
||||
) -> LemmyResult<Json<ListLoginsResponse>> {
|
||||
let logins = LoginToken::list(&mut context.pool(), local_user_view.local_user.id).await?;
|
||||
|
||||
Ok(Json(logins))
|
||||
Ok(Json(ListLoginsResponse { logins }))
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use lemmy_db_schema::{
|
||||
newtypes::{CommentReplyId, CommunityId, LanguageId, PersonId, PersonMentionId},
|
||||
sensitive::SensitiveString,
|
||||
source::site::Site,
|
||||
source::{login_token::LoginToken, site::Site},
|
||||
CommentSortType,
|
||||
ListingType,
|
||||
PostListingMode,
|
||||
|
@ -441,3 +441,10 @@ pub struct ListMedia {
|
|||
pub struct ListMediaResponse {
|
||||
pub images: Vec<LocalImageView>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone)]
|
||||
#[cfg_attr(feature = "full", derive(TS))]
|
||||
#[cfg_attr(feature = "full", ts(export))]
|
||||
pub struct ListLoginsResponse {
|
||||
pub logins: Vec<LoginToken>,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue