chore(tutorial): attempt to fix download

This commit is contained in:
Steffen Jost 2023-04-19 16:35:45 +00:00
parent 6699f1d72f
commit 13f53e3221

View File

@ -135,7 +135,7 @@ postTUsersR tid ssh csh tutn = do
let fName = letterFileName aletter
renderLetters rcvr letters apcIdent >>= \case
Left err -> sendResponseStatus internalServerError500 $ "PDF generation failed: \n" <> err
Right pdf -> Just <$> sendByteStringAsFile fName (LBS.toStrict pdf) now
Right pdf -> return $ Just (sendByteStringAsFile fName (LBS.toStrict pdf) now)
-- sendResponseByteStringFile "demoPDF.pdf" (LBS.toStrict pdf)
-- let typePDF :: ContentType
-- typePDF = "application/pdf"
@ -165,7 +165,7 @@ postTUsersR tid ssh csh tutn = do
_other -> addMessageI Error MsgErrorUnknownFormAction >> return Nothing
case tcontent of
Just content -> return content -- abort and return produced content
Just act -> act -- abort and return produced content
Nothing -> do
tutors <- runDB $ E.select $ do
(tutor :& user) <- E.from $ E.table @Tutor `E.innerJoin` E.table @User