fix(services): initialize slices to empty array to prevent null json response

This commit is contained in:
Tiago Yamamoto 2025-12-24 17:52:13 -03:00
parent 2fafd5ab37
commit 06ed927ef4
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ func (s *NotificationService) ListNotifications(ctx context.Context, userID stri
}
defer rows.Close()
var notifications []models.Notification
notifications := []models.Notification{}
for rows.Next() {
var n models.Notification
if err := rows.Scan(

View file

@ -48,7 +48,7 @@ func (s *TicketService) ListTickets(ctx context.Context, userID string) ([]model
}
defer rows.Close()
var tickets []models.Ticket
tickets := []models.Ticket{}
for rows.Next() {
var t models.Ticket
if err := rows.Scan(
@ -92,7 +92,7 @@ func (s *TicketService) GetTicket(ctx context.Context, ticketID string, userID s
}
defer rows.Close()
var messages []models.TicketMessage
messages := []models.TicketMessage{}
for rows.Next() {
var m models.TicketMessage
if err := rows.Scan(