updated pdf form to send user to pdf generator
All checks were successful
Tests / Run Go Tests (push) Successful in 3m28s
Arbeitszeitmessung Deploy / Build Go Image and Upload (push) Successful in 4m24s

This commit is contained in:
2025-12-12 15:07:57 +01:00
parent c7f8595474
commit 0eb4878c90
10 changed files with 106 additions and 72 deletions

View File

@@ -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)