aboutsummaryrefslogtreecommitdiff
path: root/src/Tomato
diff options
context:
space:
mode:
authorJacques Comeaux <jacquesrcomeaux@gmail.com>2022-05-29 18:14:10 -0500
committerJacques Comeaux <jacquesrcomeaux@gmail.com>2022-05-29 18:14:10 -0500
commit5128c855921f29f3b4f253b035461f76b2b2b8b0 (patch)
tree52867ffb014d1ecc7d15bb9b62254d076d322981 /src/Tomato
parentd0279f0658e480db7028550367ae0afc528cf7de (diff)
Make description optional
Diffstat (limited to 'src/Tomato')
-rw-r--r--src/Tomato/Data/Tomato.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Tomato/Data/Tomato.hs b/src/Tomato/Data/Tomato.hs
index 4b75adf..e74f965 100644
--- a/src/Tomato/Data/Tomato.hs
+++ b/src/Tomato/Data/Tomato.hs
@@ -6,7 +6,7 @@ module Tomato.Data.Tomato
import RIO
-import Data.Aeson ((.:))
+import Data.Aeson ((.:), (.:!))
import Network.HTTP.Req (Url, Scheme (Https), useHttpsURI)
import qualified Data.Aeson as Ae
@@ -20,7 +20,7 @@ data Tomato = Tomato
, height :: !Word
, color :: !Text
, blur_hash :: !Text
- , description :: !Text
+ , description :: !(Maybe Text)
, urls :: !Urls
, links :: !Links
} deriving Show
@@ -32,7 +32,7 @@ instance Ae.FromJSON Tomato where
<*> o .: "height"
<*> o .: "color"
<*> o .: "blur_hash"
- <*> o .: "description"
+ <*> o .:! "description"
<*> o .: "urls"
<*> o .: "links"