Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions infra/handler/app/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ testPresDeploys = withQueueName $ withEnv $ \env -> withSQS env $ withS3 env $ d
, presentationOwner = someUserId
, presentationAttributes = HMS.empty
, presentationBackground = Nothing
, presentationDescription = ""
}

let uname = Username "josph"
Expand Down
7 changes: 4 additions & 3 deletions infra/handler/src/DeckGo/Handler.hs
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ data PresentationInfo = PresentationInfo
, presentationBackground :: Maybe PresentationBackground
, presentationAttributes :: HMS.HashMap T.Text T.Text
, presentationSlides :: [Slide]
, presentationDescription :: T.Text
} deriving (Show, Eq)

data PresentationResult = PresentationResult
Expand All @@ -327,7 +328,8 @@ instance FromJSONObject PresentationInfo where
obj .: "owner_id" <*>
obj .:? "background" <*>
obj .:? "attributes" .!= HMS.empty <*>
obj .: "slides"
obj .: "slides" <*>
obj .: "description"

instance FromJSONObject PresentationResult where
parseJSONObject = undefined -- \obj ->
Expand Down Expand Up @@ -1245,11 +1247,10 @@ withPresentationFiles uname psname presentationInfo act = do
T.replace "{{DECKDECKGO_TITLE_SHORT}}" (T.take 12 $ unPresentationName pname) .
T.replace "{{DECKDECKGO_AUTHOR}}" (unUsername uname) .
T.replace "{{DECKDECKGO_USERNAME}}" (unUsername uname) .
T.replace "{{DECKDECKGO_DESCRIPTION}}" (presentationDescription presentationInfo) .
T.replace "{{DECKDECKGO_USER_ID}}"
(unFirebaseId . unUserId $ presentationOwner presentationInfo) .
T.replace "{{DECKDECKGO_DECKNAME}}" (unPresShortname psname) .
-- TODO: description
T.replace "{{DECKDECKGO_DESCRIPTION}}" "(no description given)" .
T.replace "{{DECKDECKGO_BASE_HREF}}"
("/" <> unPresentationPrefix (presentationPrefix uname psname))

Expand Down