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?