1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-29 16:56:28 +00:00
comunicapiv3/src/api_data/res_get_security_questions.rs

21 lines
556 B
Rust

//! # Get security questions results
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::user::User;
#[derive(Serialize)]
pub struct ResGetSecurityQuestions {
questions: Vec<String>
}
impl ResGetSecurityQuestions {
pub fn new(user: &User) -> ResGetSecurityQuestions {
let mut questions = Vec::new();
questions.push(user.security_question_1.clone().unwrap_or(String::new()));
questions.push(user.security_question_2.clone().unwrap_or(String::new()));
ResGetSecurityQuestions { questions }
}
}