Skip to content

Commit

Permalink
apply elmTypeAlterations in ops in Generate.mkRequest (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
1inguini authored Feb 8, 2023
1 parent a92926c commit efd6c55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Servant/Elm/Internal/Generate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -496,14 +496,14 @@ mkRequest opts request =
expect =
case request ^. F.reqReturnType of
Just elmTypeExpr
| isEmptyType opts elmTypeExpr
| isEmptyType opts $ (elmTypeAlterations opts) elmTypeExpr
-- let elmConstructor = T.pack (renderElm elmTypeExpr)
->
"Http.expectString " <> line <+> indent i "(\\x -> case x of" <> line <+>
indent i "Err e -> toMsg (Err e)" <> line <+>
indent i "Ok _ -> toMsg (Ok ()))"
Just elmTypeExpr ->
"Http.expectJson toMsg" <+> renderDecoderName elmTypeExpr
"Http.expectJson toMsg" <+> renderDecoderName ((elmTypeAlterations opts) elmTypeExpr)
Nothing -> error "mkHttpRequest: no reqReturnType?"
-- case request ^. F.reqReturnType of
-- Just elmTypeExpr | isEmptyType opts elmTypeExpr ->
Expand Down

0 comments on commit efd6c55

Please # to comment.