chore: use limits from JWT if available

This commit is contained in:
im-adithya
2023-12-05 15:58:45 +05:30
parent 62d7ffb7fe
commit e681e69fa2
24 changed files with 133 additions and 47 deletions

View File

@@ -46,6 +46,7 @@ type KeySendResponseBody struct {
func (controller *KeySendController) KeySend(c echo.Context) error {
userID := c.Get("UserID").(int64)
limits := controller.svc.GetLimitsFromContext(c)
reqBody := KeySendRequestBody{}
if err := c.Bind(&reqBody); err != nil {
c.Logger().Errorf("Failed to load keysend request body: %v", err)
@@ -75,7 +76,7 @@ func (controller *KeySendController) KeySend(c echo.Context) error {
})
}
resp, err := controller.svc.CheckOutgoingPaymentAllowed(c.Request().Context(), lnPayReq, userID)
resp, err := controller.svc.CheckOutgoingPaymentAllowed(c.Request().Context(), lnPayReq, userID, limits)
if err != nil {
return c.JSON(http.StatusInternalServerError, responses.GeneralServerError)
}