Lines
90.91 %
Functions
25 %
Branches
100 %
//! The category report's reader: empty dates are this month so far, which the form then shows.
use forms::REPORT_CATEGORY;
use rpc::forms::Outcome;
use server::command::BreakdownData;
use uuid::Uuid;
use super::query::{Asked, ask_form};
use crate::response::WebError;
pub async fn ask(
user_id: Uuid,
pairs: Vec<(String, String)>,
) -> Result<Asked<BreakdownData>, WebError> {
ask_form(user_id, pairs, &REPORT_CATEGORY, pick).await
}
fn pick(outcome: Outcome) -> Option<BreakdownData> {
match outcome {
Outcome::Breakdown(data) => Some(data),
_ => None,