summaryrefslogtreecommitdiff
path: root/Biz/Dragons.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-07-18 22:09:58 -0400
committerBen Sima <ben@bsima.me>2022-07-19 09:22:58 -0400
commitbc9e5b0ea863a17537987faa5a72b00efc7767d1 (patch)
treea22df5a00c29f5612a5f6885b9e6bb9a7a56d420 /Biz/Dragons.hs
parentf034ad709ba0de5a2e5ec6be47523f595e381d7a (diff)
Upgrade nixpkgs, ghc923
I ended up deleting miso, and consequently all files under Hero/ and Miso/, because I couldn't get miso to build with GHC 9.2. Other things: - Niv has been wrapped by Biz/Bild/Deps.hs, so I can extend it to my liking. - Apply-refact is gone because I couldn't get it to build. - Disabled python stuff.
Diffstat (limited to 'Biz/Dragons.hs')
-rw-r--r--Biz/Dragons.hs14
1 files changed, 8 insertions, 6 deletions
diff --git a/Biz/Dragons.hs b/Biz/Dragons.hs
index 0a3583d..7307f69 100644
--- a/Biz/Dragons.hs
+++ b/Biz/Dragons.hs
@@ -540,9 +540,9 @@ data Keep = Keep
$(deriveSafeCopy 0 'base ''Keep)
createUser :: User -> Acid.Update Keep User
-createUser u = do
+createUser User {..} = do
keep <- get
- let newUser = u {userId = nextUserId keep} :: User
+ let newUser = User {userId = nextUserId keep, ..}
put
<| keep
{ users = IxSet.insert newUser (users keep),
@@ -644,9 +644,10 @@ upsertGitHubUser keep tok ghUser =
|> GetUserByGitHubId
|> Acid.query keep
+> \case
- Just user ->
+ Just User {..} ->
-- if we already know this user, we need to refresh the token
- UpdateUser user {userGitHubToken = Encoding.decodeUtf8 tok}
+ User {userGitHubToken = Encoding.decodeUtf8 tok, ..}
+ |> UpdateUser
|> Acid.update keep
Nothing ->
CreateUser
@@ -1036,8 +1037,9 @@ htmlApp jwtCfg cooks kp cfg oAuthArgs =
guardAuth >=> UserAccount .> App.Html .> pure,
postAccount = \a subscription ->
guardAuth a
- +> \user ->
- UpdateUser user {userSubscription = subscription}
+ +> \User {..} ->
+ User {userSubscription = subscription, ..}
+ |> UpdateUser
|> Acid.update' kp
+> UserAccount
.> App.Html