I'm making AfterChange hooks and I stumbled onto weird problem.
I have following snippet producing error from the title
console.log("-----------------------------")
console.log("Running on: " + doc.name)
console.log("docsToUpdate")
console.log(docsToUpdate)
console.log("dataToUpdate")
console.log(dataToUpdate)
console.log("-----------------------------")
payload.update({
collection,
where: {
id: {
in: docsToUpdate
}
},
data: dataToUpdate
})
payload.update({
collection,
where: {
id: {
not_in: docsToUpdate
}
},
data: dataToDelete
})
Console.logs produce:
-----------------------------
Running on: Przystawki
docsToUpdate
[ 12 ]
dataToUpdate
{ category: 1 }
-----------------------------
Full error:
error: Invalid input syntax for type integer: "{"id":1,"name":"Przystawki","dishes":[{"id":12,"name":"1","category":1,"types":[],"updatedAt":"2024-05-17T12:32:16.576Z","createdAt":"2024-05-15T08:55:25.380Z"}],"updatedAt":"2024-05-17T12:32:16.563Z","createdAt":"2024-05-09T17:48:48.402Z"}"
Error comes from node-postgress