forked from Roflin/gamenight
Created a domain module to decouple flows from the core.
This commit is contained in:
@@ -4,7 +4,7 @@ use inquire::Select;
|
||||
|
||||
use crate::flows::view_gamenight::ViewGamenight;
|
||||
|
||||
use super::{abort::Abort, *};
|
||||
use super::{exit::Exit, *};
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ListGamenights {
|
||||
@@ -23,9 +23,9 @@ impl<'a> Flow<'a> for ListGamenights {
|
||||
let response = get_gamenights(&state.configuration).await?;
|
||||
|
||||
let mut view_flows = response.into_iter().map(|gamenight| -> Box<dyn Flow<'a> + Send> {
|
||||
Box::new(ViewGamenight::new(gamenight))
|
||||
Box::new(ViewGamenight::new(gamenight.into()))
|
||||
}).collect::<Vec<Box<dyn Flow<'a> + Send>>>();
|
||||
view_flows.push(Box::new(Abort::new()));
|
||||
view_flows.push(Box::new(Exit::new()));
|
||||
|
||||
let choice = Select::new("What gamenight would you like to view?", view_flows)
|
||||
.prompt_skippable()?;
|
||||
|
||||
Reference in New Issue
Block a user