I tried to print the result of the update operatio...
# orm-help
a
I tried to print the result of the update operation but it's not printing
n
Hey @Daniel Laera and @Arun Kumar 👋 just a quick and friendly reminder to use Slack threads for individual conversations to keep the main channel more clear 🙂
d
aw sorry I just realised that I had to open a thread
🙏 1
n
No worries at all, it's very easy to miss 😄 (and thanks for helping each other out here 🙌 ❤️)
d
with great pleasure @nikolasburk
a
@Daniel Laera This is how I tried to print the result of the update operation
Copy code
exports.patchitem= async function (req, res) {
  try {
    const result = await prisma.user.update({ where: { id: req.params.id }, data: { status: "verified" } });
    console.log("############################ Result ############################");
    console.log(result);
    return res.status(200).json(result);
  } catch (err) {
    res.json({ error: err });
  }
};
d
ok in this case the first thing I’d do is to reinstall dependencies with yarn and re-migrate, did u try to do that?
a
No. The other operations are working fine. Only this update operation is the problem.
I'm using npm run devstart to start the server
How to access the stack trace of prisma?
d
I usually have details in my console/terminal when I have errors… are u testing with a client like postman?
a
@nikolasburk Can I use them in the .env file?
@Daniel Laera Th error in this case is
{"clientVersion":"2.23.0"}
There isn't any additional information.
d
https://www.prisma.io/docs/reference/api-reference/error-reference Did you also take a look at this and see if there are any exception or error code?
I link this because severals exception crashes could have an error code linked with a client version error
a
yes. But the response doesn't indicate the type of error. That is the problem
@Daniel Laera Thanks for the help. Just found the error. Seems like I need to parse the where condition variables to Integer.
✅ 1
d
interesting, so your
req.params.id
need to be casted to Int?
Number(<your_id>)
?
a
Yes.