This commit is contained in:
mm 2024-10-21 11:12:30 +05:00
parent 900650ace4
commit 9fe3041a44

View File

@ -4,6 +4,7 @@ import (
"context"
"donat-widget/internal/model"
"donat-widget/internal/model/api"
"fmt"
"log/slog"
)
@ -39,10 +40,11 @@ func (donatService *ServiceDonat) CreateDonat(
slog.Error("donatService.widgetRepo.GetAllWidget: ", err)
return api.CreatePaymentResponse{}, err
}
fmt.Println(widgets)
var widgetID model.WidgetID
for _, widget := range widgets {
if widget.MinAmount <= amount {
if widget.MinAmount >= amount {
widgetID = widget.ID
}
}