all sales
This commit is contained in:
@ -520,3 +520,11 @@ func (app *application) ResetPassword(w http.ResponseWriter, r *http.Request) {
|
||||
resp.Message = "Password reset."
|
||||
app.writeJSON(w, http.StatusCreated, resp)
|
||||
}
|
||||
|
||||
func (app *application) AllSales(w http.ResponseWriter, r *http.Request) {
|
||||
allSales, err := app.DB.GetAllOrders()
|
||||
if err != nil {
|
||||
app.badRequest(w, r, err)
|
||||
}
|
||||
app.writeJSON(w, http.StatusOK, allSales)
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ func (app *application) routes() http.Handler {
|
||||
// })
|
||||
|
||||
mux.Post("/virtual-terminal-succeeded", app.VirtualTerminalPaymentSucceeded)
|
||||
mux.Post("/all-sales", app.AllSales)
|
||||
})
|
||||
mux.Post("/api/forgot-password", app.SendPasswordResetEmail)
|
||||
mux.Post("/api/reset-password", app.ResetPassword)
|
||||
|
Reference in New Issue
Block a user