Skip to content

Commit

Permalink
fix: export default (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
matmut7 authored Oct 18, 2024
1 parent bb8731f commit 8666ff9
Show file tree
Hide file tree
Showing 17 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion src/lib/prismaClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ declare global {
var prismaClient: PrismaClient | undefined;
}

export const client =
const client =
globalThis.prismaClient ??
new PrismaClient({
datasources: {
Expand All @@ -16,3 +16,5 @@ export const client =
});

globalThis.prismaClient = client;

export default client;
2 changes: 1 addition & 1 deletion src/pages/api/commentaires/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiHandler, NextApiRequest } from "next";
import { getSession } from "next-auth/react";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/commissions/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { withSentry } from "@sentry/nextjs";
import type { NextApiHandler, NextApiRequest } from "next";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const { id: commissionIdStr } = req.query;
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/commissions/date/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { withSentry } from "@sentry/nextjs";
import type { NextApiHandler } from "next";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
if (req.method == "GET") {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/commissions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiHandler, NextApiRequest } from "next";
import { getSession } from "next-auth/react";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/commissions/upcoming/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { withSentry } from "@sentry/nextjs";
import type { NextApiHandler } from "next";
import { getSession } from "next-auth/react";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/dossiers/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { TransitionEvent } from "src/lib/statutDossierStateMachine";
import { factory as statutDossierStateMachineFactory } from "src/lib/statutDossierStateMachine";
import superjson from "superjson";

import { client } from "src/lib/prismaClient"
import client from "src/lib/prismaClient"

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/enfant/[id].ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiHandler, NextApiRequest } from "next";
import { getSession } from "next-auth/react";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/enfants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiHandler } from "next";
import { getSession } from "next-auth/react";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/search.json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getSession } from "next-auth/react";
import { searchDossiers, searchEnfants } from "src/lib/queries";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
if (req.method !== "GET") {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/sendlist/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiHandler, NextApiRequest } from "next";
import { getSession } from "next-auth/react";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/sync/inc/dossiers/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { withSentry } from "@sentry/nextjs";
import type { NextApiHandler, NextApiRequest } from "next";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
if (req.method === "GET") {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/sync/inc/dossiers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
import { frenchDateText, frenchDepartementName } from "src/lib/helpers";
import type { z } from "zod";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

export const config = {
api: {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/sync/inc/enfant/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { withSentry } from "@sentry/nextjs";
import type { NextApiHandler, NextApiRequest } from "next";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
if (req.method == "DELETE") {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/users/id/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { NextApiHandler } from "next";
import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";
import { getSession } from "next-auth/react";

const handler: NextApiHandler = async (req, res) => {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/users/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getSession } from "next-auth/react";
import superjson from "superjson";

import { Role } from "@prisma/client";
import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/users/search/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextApiHandler } from "next";
import { getSession } from "next-auth/react";
import superjson from "superjson";

import { client } from "src/lib/prismaClient";
import client from "src/lib/prismaClient";

const handler: NextApiHandler = async (req, res) => {
const session = await getSession({ req });
Expand Down

0 comments on commit 8666ff9

Please sign in to comment.