Sending invoice from the BE
This commit is contained in:
		@ -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)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user