Skip to content

Commit

Permalink
print errors for notification request
Browse files Browse the repository at this point in the history
  • Loading branch information
konrad2002 committed Dec 7, 2024
1 parent eac6b6d commit 329519a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions controller/notification_controller.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package controller

import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/swimresults/user-service/dto"
"github.com/swimresults/user-service/service"
Expand Down Expand Up @@ -119,12 +120,14 @@ func sendNotificationForMeetingAndAthlete(c *gin.Context) {

var request dto.MeetingNotificationRequestDto
if err := c.BindJSON(&request); err != nil {
println("binding MeetingNotificationRequestDto failed")
c.IndentedJSON(http.StatusInternalServerError, gin.H{"message": err.Error()})
return
}

users, notificationUsers, success, err := service.SendPushNotificationForMeetingAndAthletes(meeting, []primitive.ObjectID{athleteId}, request)
if err != nil {
fmt.Printf("sendNotificationForMeetingAndAthlete failed: %d\n", err)
c.IndentedJSON(http.StatusInternalServerError, gin.H{"message": err.Error()})
return
}
Expand Down

0 comments on commit 329519a

Please sign in to comment.