mirror of
https://gitlab.com/comunic/comunicapiv3
synced 2025-06-21 00:45:18 +00:00
Can get the list of available target to create new posts
This commit is contained in:
@ -35,4 +35,5 @@ pub mod movie_api;
|
||||
pub mod survey_choice_api;
|
||||
pub mod survey_api;
|
||||
pub mod comment_api;
|
||||
pub mod res_create_post;
|
||||
pub mod res_create_post;
|
||||
pub mod posts_targets_api;
|
22
src/api_data/posts_targets_api.rs
Normal file
22
src/api_data/posts_targets_api.rs
Normal file
@ -0,0 +1,22 @@
|
||||
//! # 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(),
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user