From 3c51fb5dda9e346c18805c867d047130191da4b1 Mon Sep 17 00:00:00 2001 From: Saku Laesvuori Date: Mon, 10 Apr 2023 11:44:51 +0300 Subject: [PATCH] Update dependencies --- Client/Handlers/Apply.hs | 3 +- Client/Handlers/Profile.hs | 17 ++++---- Client/Types.hs | 48 ++++++++++----------- Server/API.hs | 2 + channels.scm | 11 +++++ datarekisteri.cabal | 51 +++++++++++++++++++++- guix.scm | 86 +++++++++++--------------------------- 7 files changed, 123 insertions(+), 95 deletions(-) create mode 100644 channels.scm 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|