git.iko.soy/haskell-servant/servant-elm
on master help sign in
apply elmTypeAlterations in ops in Generate.mkRequest (#64)
commitefd6c55389cd64a1604dc349ab440f8871f40d23 author1inguini <42938754+1inguini@users.noreply.github.com> dateThu 9 Feb 2023, 02:47 (4 years ago) parenta92926c
1 file changed+2−2
src/Servant/Elm/Internal/Generate.hs+2−2
src/Servant/Elm/Internal/Generate.hs+2−2
@@ -496,14 +496,14 @@ mkRequest opts request =
496496 expect =
497497 case request ^. F.reqReturnType of
498498 Just elmTypeExpr
499− | isEmptyType opts elmTypeExpr
499+ | isEmptyType opts $ (elmTypeAlterations opts) elmTypeExpr
500500 -- let elmConstructor = T.pack (renderElm elmTypeExpr)
501501 ->
502502 "Http.expectString " <> line <+> indent i "(\\x -> case x of" <> line <+>
503503 indent i "Err e -> toMsg (Err e)" <> line <+>
504504 indent i "Ok _ -> toMsg (Ok ()))"
505505 Just elmTypeExpr ->
506− "Http.expectJson toMsg" <+> renderDecoderName elmTypeExpr
506+ "Http.expectJson toMsg" <+> renderDecoderName ((elmTypeAlterations opts) elmTypeExpr)
507507 Nothing -> error "mkHttpRequest: no reqReturnType?"
508508 -- case request ^. F.reqReturnType of
509509 -- Just elmTypeExpr | isEmptyType opts elmTypeExpr ->