1
//! The `transaction-query` s-expression over [`crate::forms::query`].
2

            
3
use forms::{FormValues, TRANSACTION_QUERY};
4
use scripting::runtime::EvalValue;
5
use uuid::Uuid;
6

            
7
use super::counted;
8
use crate::forms::{FormAction, Outcome, query};
9

            
10
/// Result: the [`Outcome::Page`] wire.
11
1808
pub async fn run_transaction_query(
12
1808
    user_id: Uuid,
13
1808
    values: &FormValues,
14
1808
) -> wasmtime::Result<EvalValue> {
15
1808
    let page = query(user_id, values).await;
16
1648
    Outcome::Page(counted(TRANSACTION_QUERY.name, FormAction::Query, page)?).to_value()
17
1648
}