File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,24 +25,22 @@ impl FallibleTemplate for IndexTemplate {
2525}
2626
2727impl IndexTemplate {
28- pub async fn new (
29- context : AppStateContext ,
30- status : StatusCookie ,
31- ) -> Result < FlashTemplate < Self > , AppStateError > {
28+ pub async fn new ( context : AppStateContext ) -> Result < Self , AppStateError > {
3229 let categories = context. db . category ( ) . list ( ) . await . context ( CategorySnafu ) ?;
3330 let children = FileSystemEntry :: from_categories ( & categories) ;
3431
35- Ok ( status . with_template ( IndexTemplate {
32+ Ok ( Self {
3633 state : context,
3734 flash : None ,
3835 children,
39- } ) )
36+ } )
4037 }
4138}
4239
4340pub async fn index (
4441 context : AppStateContext ,
4542 status : StatusCookie ,
4643) -> Result < FlashTemplate < IndexTemplate > , AppStateError > {
47- IndexTemplate :: new ( context, status) . await
44+ let template = IndexTemplate :: new ( context) . await ?;
45+ Ok ( status. with_template ( template) )
4846}
You can’t perform that action at this time.
0 commit comments