This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PrismaClient } from '@prisma/client' | |
const dbClient = new PrismaClient({}) | |
/* | |
* Middleware to replace hard deletes with soft deletes | |
* 1. deletes will update deletedAt column | |
* 2. finds and updates will filter out deletedAt rows | |
*/ | |
dbClient.$use(async (params, next) => { |