Skip to content

Commit ec0c489

Browse files
committed
update array responses
1 parent ad81955 commit ec0c489

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

main.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -156,15 +156,13 @@ func sendNotificationMultipleDevice(c *gin.Context) {
156156
Condition: req.Condition,
157157
FCMOptions: req.FCMOptions,
158158
}
159-
response, _ := fcmClient.Send(context.Background(), message)
159+
response, err := fcmClient.Send(context.Background(), message)
160160

161-
// if err != nil {
162-
// log.Printf("Send message error: %v", err)
163-
// c.JSON(http.StatusInternalServerError, gin.H{"error": "Send message error!."})
164-
// return
165-
// }
166-
167-
responses = append(responses, response)
161+
if err != nil {
162+
responses = append(responses, err.Error())
163+
} else {
164+
responses = append(responses, response)
165+
}
168166
}
169167

170168
c.JSON(http.StatusOK, gin.H{

0 commit comments

Comments
 (0)