From 2229ac56d6fe218f44f31fa99b67b4e871d14314 Mon Sep 17 00:00:00 2001 From: kiwiidb Date: Fri, 28 Oct 2022 10:51:27 +0200 Subject: [PATCH] fix bug: no model needed here --- controllers/payinvoice.ctrl.go | 2 +- controllers_v2/payinvoice.ctrl.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/payinvoice.ctrl.go b/controllers/payinvoice.ctrl.go index cd4a445..b8242b8 100644 --- a/controllers/payinvoice.ctrl.go +++ b/controllers/payinvoice.ctrl.go @@ -87,7 +87,7 @@ func (controller *PayInvoiceController) PayInvoice(c echo.Context) error { currentBalance, err := controller.svc.CurrentUserBalance(c.Request().Context(), userID) if err != nil { - controller.svc.DB.NewDelete().Model(&invoice).Where("id = ?", invoice.ID).Exec(c.Request().Context()) + controller.svc.DB.NewDelete().Where("id = ?", invoice.ID).Exec(c.Request().Context()) return err } diff --git a/controllers_v2/payinvoice.ctrl.go b/controllers_v2/payinvoice.ctrl.go index de770dc..7dabc8f 100644 --- a/controllers_v2/payinvoice.ctrl.go +++ b/controllers_v2/payinvoice.ctrl.go @@ -89,7 +89,7 @@ func (controller *PayInvoiceController) PayInvoice(c echo.Context) error { currentBalance, err := controller.svc.CurrentUserBalance(c.Request().Context(), userID) if err != nil { - controller.svc.DB.NewDelete().Model(&invoice).Where("id = ?", invoice.ID).Exec(c.Request().Context()) + controller.svc.DB.NewDelete().Where("id = ?", invoice.ID).Exec(c.Request().Context()) return err }