Pedro Bonamin
07/13/2022, 1:29 PMRichard Ward
07/13/2022, 1:40 PMupdateMany
should work with what you have..Richard Ward
07/13/2022, 1:41 PMprisma.product.updateMany({
where: {
userId: userId,
id: req.query.id
}
});
there's an implicit AND
between those ..Pedro Bonamin
07/13/2022, 2:26 PMPedro Bonamin
07/13/2022, 2:26 PMYuval Datner
07/13/2022, 9:26 PMlet product = await prisma.product.findFirst({where: { userId, id }})
if (!product) throw new NotFoundError()
product = await prisma.product.update({ where: {id}, data: input})