use crate::{get_public, post_public};
use crate::model::character::{Character, CharacterAffiliation};
pub async fn get_character(character_id: i32) -> Result<Character, reqwest::Error> {
get_public::<Character>(&format!("characters/{}", character_id), None).await
}
pub async fn get_character_agents_research(character_id: i32) -> Result<Vec<i32>, reqwest::Error> {
get_public::<Vec<i32>>(
&format!("characters/{}/agents_research", character_id),
None,
)
.await
}
pub async fn get_character_affiliations(
character_ids: Vec<i32>,
) -> Result<Vec<CharacterAffiliation>, reqwest::Error> {
post_public::<Vec<CharacterAffiliation>, Vec<i32>>("characters/affiliation", None, &character_ids)
.await
}