Skip to content

Commit

Permalink
Update fromDBComment to use mkTopic and mkCommentText
Browse files Browse the repository at this point in the history
  • Loading branch information
FaneBastinBellroy committed Apr 20, 2022
1 parent 5d7bde4 commit ddfa120
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Level04/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,9 @@ encodeComment = E.mapLikeObj $ \c ->
fromDBComment
:: DBComment
-> Either Error Comment
fromDBComment dc =
pure $ Comment
(CommentId $ dbCommentId dc)
(Topic $ dbCommentTopic dc)
(CommentText $ dbCommentBody dc)
(dbCommentTime dc)
fromDBComment (DBComment i tp tx t) =
Comment (CommentId i) <$> mkTopic tp <*>
mkCommentText tx <*> pure t

data RqType
= AddRq Topic CommentText
Expand Down

0 comments on commit ddfa120

Please sign in to comment.