Question on Prisma 2 middleware. The name of the m...
# orm-help
b
Question on Prisma 2 middleware. The name of the model comes in params.model. How can I check if that model contains a specific property ? If we use the docs as an example, how could I check if language was actually defined as a property on 'Post' before setting it?
Copy code
prisma.$use(async (params, next) => {
  if (params.model == 'Post' && params.action == 'create') {
    params.args.data.language = contextLanguage
  }

  return next(params)
})