mirror of
https://github.com/getAlby/lndhub.go.git
synced 2026-02-23 13:54:25 +01:00
Merge pull request #189 from getAlby/fix/amt-validations
Fix/amt-validations
This commit is contained in:
@@ -61,7 +61,7 @@ func AddInvoice(c echo.Context, svc *service.LndhubService, userID int64) error
|
||||
}
|
||||
|
||||
amount, err := svc.ParseInt(body.Amount)
|
||||
if err != nil {
|
||||
if err != nil || amount < 0 {
|
||||
return c.JSON(http.StatusBadRequest, responses.BadArgumentsError)
|
||||
}
|
||||
c.Logger().Infof("Adding invoice: user_id:%v memo:%s value:%v description_hash:%s", userID, body.Memo, amount, body.DescriptionHash)
|
||||
|
||||
@@ -24,7 +24,7 @@ func NewKeySendController(svc *service.LndhubService) *KeySendController {
|
||||
}
|
||||
|
||||
type KeySendRequestBody struct {
|
||||
Amount int64 `json:"amount" validate:"required"`
|
||||
Amount int64 `json:"amount" validate:"required,gt=0"`
|
||||
Destination string `json:"destination" validate:"required"`
|
||||
Memo string `json:"memo" validate:"omitempty"`
|
||||
CustomRecords map[string]string `json:"customRecords" validate:"omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user