UNPKG

@prisma-extensions/soft-delete

Version:

Soft Delete can be used to hide records instead of deleting them, making them recoverable later.

13 lines (12 loc) 302 B
export async function scopedQuery< A extends { where?: Record<string, unknown> }, Q extends (args: A) => Promise<ReturnType<Q>>, >({ args, query }: { args: A; query: Q }): Promise<ReturnType<Q>> { return query({ ...args, where: { deletedAt: null, ...args.where, }, }) }