mirror of
https://github.com/getAlby/lndhub.go.git
synced 2025-12-24 08:05:02 +01:00
Use request context in handlers
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/getAlby/lndhub.go/lib/service"
|
||||
@@ -20,7 +19,7 @@ func NewBalanceController(svc *service.LndhubService) *BalanceController {
|
||||
// Balance : Balance Controller
|
||||
func (controller *BalanceController) Balance(c echo.Context) error {
|
||||
userId := c.Get("UserID").(int64)
|
||||
balance, err := controller.svc.CurrentUserBalance(context.TODO(), userId)
|
||||
balance, err := controller.svc.CurrentUserBalance(c.Request().Context(), userId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user