Lines
90.91 %
Functions
25 %
Branches
100 %
//! The activity report's reader: empty dates are this month so far, which the form then shows.
use forms::REPORT_ACTIVITY;
use rpc::forms::Outcome;
use server::command::ActivityData;
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<ActivityData>, WebError> {
ask_form(user_id, pairs, &REPORT_ACTIVITY, pick).await
}
fn pick(outcome: Outcome) -> Option<ActivityData> {
match outcome {
Outcome::Activity(data) => Some(data),
_ => None,