PrismaP
Prisma2mo ago
2 replies
KaKi87

Upsert question

Hi,
Why does Prisma's upsert method has separate create and update objects ?
From my past experience, all libs I've used only needed one for both and I never needed separate values.
So, I'm tempted to make a wrapper kind of like this :
const upsertModel = (model, where, data) => model.upsert({ where, create: data, update: data }));
What am I missing ?
Thanks
Was this page helpful?