Hi,
I have an App action that runs and send notifications based on certain condition. When I use instance.batchInsert(notificationsToBeSent).then(() => {//Some other code in there}) I am getting 400 error and the response says, {“message”:“val.replace is not a function”}. I have double checked my code and everything is working as expected. Maybe the object that I am sending to batch insert has an issue but I checked and everything looks good. My code does not have val.replace anywhere or “val” either.
The value of notificationsToBeSent that I am sending to batch insert is,
[
{
“data”: {
“navigate”: {
“action”: “screen”,
“page”: 408335,
“query”: “?event=29kuYUjlTiCGkasdznuz42e”,
“transition”: “none”
},
“title”: “Hello! Aren’t you coming?”,
“message”: “In 2HR, Event will start! Click to RSVP”
},
“pushNotification”: {
“payload”: {
“custom”: {
“customData”: {
“action”: “screen”,
“page”: 242515,
“transition”: “none”
}
},
“title”: “Hello! Aren’t you coming?”,
“body”: “In 2HR, the Event will start! Click to RSVP”
}
},
“status”: “published”,
“scope”: {
“Email”: {
“$nin”: [
“someEmail@gmail.com”,
“someOtherEmail@gmail.com”,
“someEmail2@gmail.com”,
]
}
}
}
]