diff --git a/response.go b/response.go index 7c03b15..525023a 100644 --- a/response.go +++ b/response.go @@ -27,6 +27,17 @@ type header struct { val string } +// TODO add doc +func (rs *Response) BufferPDF(name string, b bytes.Buffer) *Response { + + if rs.isTerminated == false { + rs.HttpResponseWriter.Header().Add("Content-Type", "application/pdf") + rs.HttpResponseWriter.Header().Add("Content-Disposition", "attachment; filename="+name) + b.WriteTo(rs.HttpResponseWriter) + } + return rs +} + // TODO add doc func (rs *Response) Any(body any) *Response { if rs.isTerminated == false { diff --git a/template/components/content_dropdown.go b/template/components/content_dropdown.go index 78c41c7..65eb21f 100644 --- a/template/components/content_dropdown.go +++ b/template/components/content_dropdown.go @@ -1,6 +1,7 @@ package components type ContentDropdown struct { + ID string Label string TypeClass string // type primary, secondary, success, danger, warning, info, light, dark, link, outline-primary IsDisabled bool