Skip to content

Commit

Permalink
update prisma to use singleton pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
135ze committed Oct 19, 2024
1 parent 717785e commit bdf4ec0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/api/users/email/[email].ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Prisma, PrismaClient } from '@prisma/client';
import { Prisma } from '@prisma/client';
import { prisma } from '../../../../../utils/prisma';

import type { NextApiRequest, NextApiResponse } from 'next';
const prisma = new PrismaClient();

async function getRandomUser() {
const user = await prisma.user.findFirstOrThrow({
Expand Down

0 comments on commit bdf4ec0

Please sign in to comment.