chemlib/store/
reaction_store.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use common::store::{build_exp_link,post};
use uuid::Uuid;

use crate::dto::reaction_response::ReactionResponse;

const DOMAIN: &str = "chem";

pub struct ReactionStore {}

impl ReactionStore {
    //возвращает список возможных реакций (при разных услвиях, условия опр. на клиенте)
    pub async fn get_reaction_by_reagents(reagents:Vec<Uuid>) -> Result<Vec<ReactionResponse>, String> {
        post::<Vec<Uuid>, Vec<ReactionResponse>>(
            build_exp_link(DOMAIN, format!("/reaction/getByReagents")),
                reagents
        ).await
    }
}