diff --git a/Client/Handlers/Apply.hs b/Client/Handlers/Apply.hs index 0645b23..599e6ef 100644 --- a/Client/Handlers/Apply.hs +++ b/Client/Handlers/Apply.hs @@ -80,6 +80,7 @@ postApplyR :: (YesodAuth DataIdClient, AuthId DataIdClient ~ Text) => Handler Ht postApplyR = do ((result, widget), enctype) <- runFormPost applyForm case result of - FormSuccess application -> apiRequest @Apply False application >>= \x -> redirect $ ProfileR $ id (apply x :: ApplyApply) + FormSuccess application -> apiRequest @Apply False application >>= \x -> + redirect $ ProfileR $ let ApplyApply {..} = apply x in id _ -> do defaultLayout $ applyW (widget, enctype) diff --git a/Client/Handlers/Profile.hs b/Client/Handlers/Profile.hs index da7d451..fd1531e 100644 --- a/Client/Handlers/Profile.hs +++ b/Client/Handlers/Profile.hs @@ -60,18 +60,18 @@ passwordForm = renderDivs $ areq verifiedPasswordField "Uusi salasana" Nothing profileForm :: (Maybe UserID) -> (Maybe ProfilePageUser) -> Form UpdateProfileArgs profileForm userID user extraHtml = do (nameRes, nameView) <- mopt textField "Nimi" - (Just $ maybe Nothing (\x -> Just $ name (x :: ProfilePageUser)) user) + (Just $ maybe Nothing (\x -> Just $ let ProfilePageUser {..} = x in name) user) (homeRes, homeView) <- mopt textField "Kotipaikka" - (Just $ maybe Nothing (\x -> Just $ homeplace (x :: ProfilePageUser)) user) + (Just $ maybe Nothing (\x -> Just $ let ProfilePageUser {..} = x in homeplace) user) (nicknameRes, nicknameView) <- mopt textField "Kutsumanimi" - (Just $ maybe Nothing (\x -> Just $ nickname (x :: ProfilePageUser)) user) + (Just $ maybe Nothing (\x -> Just $ let ProfilePageUser {..} = x in nickname) user) (emailRes, emailView) <- mopt emailField "Sähköposti" - (maybe Nothing (\x -> Just $ email (x :: ProfilePageUser)) user) + (maybe Nothing (\x -> Just $ let ProfilePageUser {..} = x in email) user) (phoneNumberRes, phoneNumberView) <- mopt telephoneField "Puhelinnumero" - (Just $ maybe Nothing (\x -> Just $ phoneNumber (x :: ProfilePageUser)) user) + (Just $ maybe Nothing (\x -> Just $ let ProfilePageUser {..} = x in phoneNumber) user) let profileUpdateRes = UpdateProfileArgs userID <$> nameRes <*> homeRes <*> nicknameRes <*> emailRes <*> phoneNumberRes - maybePendingEmail = user >>= \x -> pendingEmail (x :: ProfilePageUser) + maybePendingEmail = user >>= \x -> let ProfilePageUser {..} = x in pendingEmail inputField FieldView {..} = [whamlet|