0

I want building several miniFunction for prisma like this:



 const prismaUpdateMany = async (table, whereVariable, dataVariable) => {
 return await prisma.table.updateMany({
   where: {
     whereVariable,
   },
   data: {
     dataVariable,
   },
 });
 }

How can I put variable in this place (table)?

 prisma.$table.updateMany

Maybe my idea is incorrect, what I should do in this case, to achieve a similar goal?

Bergi
  • 572,313
  • 128
  • 898
  • 1,281
robokonk
  • 35
  • 3

0 Answers0