Sending invoice from the BE

This commit is contained in:
2024-08-27 13:52:36 +02:00
parent 9b31ff0bbb
commit 082c75283d
3 changed files with 111 additions and 2 deletions

View File

@ -17,7 +17,7 @@ type Order struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Email string `json:"email"`
CreatedAt time.Time `json:"-"`
CreatedAt time.Time `json:"created_at"`
}
func (app *application) CreateAndSendInvoice(w http.ResponseWriter, r *http.Request) {
@ -29,6 +29,7 @@ func (app *application) CreateAndSendInvoice(w http.ResponseWriter, r *http.Requ
app.badRequest(w, r, err)
return
}
app.infoLog.Println(order)
// generate a pdf invoice
err = app.createInvoicePDF(order)