Pass hierarchical route arguments to subsites
This commit is contained in:
parent
d6cd13a423
commit
9859fe1ddb
@ -176,9 +176,10 @@ mkDispatchClause MkDispatchSettings {..} resources = do
|
|||||||
subDispatcherE <- mdsSubDispatcher
|
subDispatcherE <- mdsSubDispatcher
|
||||||
runHandlerE <- mdsRunHandler
|
runHandlerE <- mdsRunHandler
|
||||||
sub <- newName "sub"
|
sub <- newName "sub"
|
||||||
|
let allDyns = extraParams ++ dyns
|
||||||
sroute <- newName "sroute"
|
sroute <- newName "sroute"
|
||||||
let sub2 = LamE [VarP sub]
|
let sub2 = LamE [VarP sub]
|
||||||
(foldl' (\a b -> a `AppE` b) (VarE (mkName getSub) `AppE` VarE sub) dyns)
|
(foldl' (\a b -> a `AppE` b) (VarE (mkName getSub) `AppE` VarE sub) allDyns)
|
||||||
let reqExp' = setPathInfoE `AppE` VarE restPath `AppE` reqExp
|
let reqExp' = setPathInfoE `AppE` VarE restPath `AppE` reqExp
|
||||||
route' = foldl' AppE (ConE (mkName name)) dyns
|
route' = foldl' AppE (ConE (mkName name)) dyns
|
||||||
route = LamE [VarP sroute] $ foldr AppE (AppE route' $ VarE sroute) extraCons
|
route = LamE [VarP sroute] $ foldr AppE (AppE route' $ VarE sroute) extraCons
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user