Skip to content

Instantly share code, notes, and snippets.

@rjhilgefort
Created July 12, 2022 21:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rjhilgefort/5898573e80611ac4a2cfa9676db03001 to your computer and use it in GitHub Desktop.
Save rjhilgefort/5898573e80611ac4a2cfa9676db03001 to your computer and use it in GitHub Desktop.
export const poop =
({ prismaClient }: { prismaClient: PrismaClient }) =>
<T extends Prisma.IncidentFindManyArgs>(
slackChannelId: ChannelId,
args?: Prisma.SelectSubset<T, Prisma.IncidentFindManyArgs>,
) => {
const args_ = { ...args, where: { slackChannelId } } as Prisma.SelectSubset<
T,
Prisma.IncidentFindManyArgs
>
return prismaClient.incident._findMany<T>(args_)
}
const pc = 'pc' as unknown as PrismaClient
poop({ prismaClient: pc })('hi', {
include: { canReports: true },
}).then((x) => x)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment