1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-11-27 15:59:21 +00:00
comunicapiv3/src/api_data/posts_targets_api.rs

22 lines
477 B
Rust

//! # Posts targets
//!
//! @author Pierre Hubert
use serde::Serialize;
use crate::data::group_id::GroupID;
use crate::data::user::UserID;
#[derive(Serialize)]
pub struct PostsTargets {
friends: Vec<u64>,
groups: Vec<u64>,
}
impl PostsTargets {
pub fn new(f: &Vec<UserID>, g: &Vec<GroupID>) -> PostsTargets {
PostsTargets {
friends: f.iter().map(|f| f.id()).collect(),
groups: g.iter().map(|f| f.id()).collect(),
}
}
}