showing logs on upcoming events

This commit is contained in:
Samuel Tariku 2025-04-28 22:52:00 +03:00
parent f68155dccd
commit b5166fa53d
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
package handlers
import (
"fmt"
"strconv"
"github.com/SamuelTariku/FortuneBet-Backend/internal/domain"
@ -119,7 +120,9 @@ func (h *Handler) GetAllUpcomingEvents(c *fiber.Ctx) error {
events, total, err := h.eventSvc.GetPaginatedUpcomingEvents(c.Context(), int32(pageSize), int32(page)-1, leagueID, sportID)
fmt.Printf("League ID: %v", leagueID)
if err != nil {
h.logger.Error("getting error", err)
return response.WriteJSON(c, fiber.StatusInternalServerError, "Failed to retrieve all upcoming events", nil, nil)
}
@ -190,4 +193,3 @@ func (h *Handler) GetPrematchOddsByUpcomingID(c *fiber.Ctx) error {
return response.WriteJSON(c, fiber.StatusOK, "Prematch odds retrieved successfully", odds, nil)
}

View File

@ -140,7 +140,7 @@ func (h *Handler) TransferToWallet(c *fiber.Ctx) error {
} else if role == string(domain.RoleBranchManager) || role == string(domain.RoleAdmin) || role == string(domain.RoleSuperAdmin) {
company, err := h.companySvc.GetCompanyByID(c.Context(), companyID)
if err != nil {
return response.WriteJSON(c, fiber.StatusInternalServerError, "Unauthorized access", nil, nil)
return response.WriteJSON(c, fiber.StatusInternalServerError, "Error fetching company", err, nil)
}
senderID = company.WalletID
h.logger.Error("Will", "userID", userID, "role", role)