updated pdf form to send user to pdf generator
This commit is contained in:
@@ -96,10 +96,14 @@ func PDFCreateController(w http.ResponseWriter, r *http.Request) {
|
||||
if err != nil {
|
||||
slog.Warn("Could not create pdf report", slog.Any("Error", err))
|
||||
}
|
||||
|
||||
w.Header().Set("Content-type", "application/pdf")
|
||||
output.WriteTo(w)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
switch pp.ParseStringFallback("output", "render") {
|
||||
case "render":
|
||||
w.Header().Set("Content-type", "application/pdf")
|
||||
output.WriteTo(w)
|
||||
w.WriteHeader(http.StatusOK)
|
||||
case "download":
|
||||
panic("Not implemented")
|
||||
}
|
||||
|
||||
default:
|
||||
http.Error(w, "Method not allowed!", http.StatusMethodNotAllowed)
|
||||
|
||||
Reference in New Issue
Block a user