mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Get user page status
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
//! @author Pierre Hubert
|
||||
use serde::Serialize;
|
||||
|
||||
use crate::data::user::User;
|
||||
use crate::data::user::{User, UserPageStatus};
|
||||
|
||||
#[derive(Serialize)]
|
||||
#[allow(non_snake_case)]
|
||||
@ -11,6 +11,8 @@ pub struct APIUserInfo {
|
||||
userID: i64,
|
||||
firstName: String,
|
||||
lastName: String,
|
||||
publicPage: bool,
|
||||
openPage: bool,
|
||||
}
|
||||
|
||||
impl APIUserInfo {
|
||||
@ -19,6 +21,8 @@ impl APIUserInfo {
|
||||
userID: info.id,
|
||||
firstName: info.first_name,
|
||||
lastName: info.last_name,
|
||||
publicPage: info.status != UserPageStatus::PRIVATE,
|
||||
openPage: info.status == UserPageStatus::OPEN,
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user