Created
September 12, 2018 09:45
-
-
Save mattrobertsky/c383731007bdf51218488f67ad88830c to your computer and use it in GitHub Desktop.
epiphany pdf check hack
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def varyReturn(sdilRef: String): Action[JsValue] = | |
Action.async(parse.json) { implicit request => | |
withJsonBody[ReturnVariationData] { data => | |
Logger.info("SDIL return variation sent to DMS queue") | |
val page = views.html.return_variation_pdf(data, sdilRef).toString | |
// TODO gist this.. | |
import sys.process._ | |
import java.io.PrintWriter | |
val temp = java.io.File.createTempFile("variations", ".html") | |
new PrintWriter(temp) { write(page); close } | |
s"epiphany $temp".! | |
concurrent.Future.successful(NoContent) | |
// TODO - implement lines below | |
// for { | |
// _ <- gforms.submitToDms(page, sdilRef) | |
// _ <- returnSubmission.save(data, sdilRef) | |
// } yield NoContent | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment