From e15f6abc9b173fcfe0800bae3b9b904172cfff2a Mon Sep 17 00:00:00 2001 From: zomars Date: Fri, 2 Dec 2022 15:22:56 -0700 Subject: [PATCH] Fixes --- lib/helpers/customPrisma.ts | 7 +++---- pages/api/users/_get.ts | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/helpers/customPrisma.ts b/lib/helpers/customPrisma.ts index f374048499..255ddc509a 100644 --- a/lib/helpers/customPrisma.ts +++ b/lib/helpers/customPrisma.ts @@ -2,10 +2,11 @@ import { hash } from "bcryptjs"; import cache from "memory-cache"; import { NextMiddleware } from "next-api-middleware"; -import { PRISMA_CLIENT_CACHING_TIME } from "@calcom/api/lib/constants"; import { CONSOLE_URL } from "@calcom/lib/constants"; import { prisma, customPrisma } from "@calcom/prisma"; +import { PRISMA_CLIENT_CACHING_TIME } from "../../lib/constants"; + // This replaces the prisma client for the cusotm one if the key is valid export const customPrismaClient: NextMiddleware = async (req, res, next) => { const { @@ -18,9 +19,7 @@ export const customPrismaClient: NextMiddleware = async (req, res, next) => { return; } // If we have a key, we check if the deployment matching the key, has a databaseUrl value set. - const databaseUrl = await fetch( - `${process.env.NEXT_PUBLIC_CONSOLE_URL || CONSOLE_URL}/api/deployments/database?key=${key}` - ) + const databaseUrl = await fetch(`${CONSOLE_URL}/api/deployments/database?key=${key}`) .then((res) => res.json()) .then((res) => res.databaseUrl); diff --git a/pages/api/users/_get.ts b/pages/api/users/_get.ts index 6c6e140e7a..6e9b9c1c2b 100644 --- a/pages/api/users/_get.ts +++ b/pages/api/users/_get.ts @@ -1,3 +1,4 @@ +import { Prisma } from "@prisma/client"; import type { NextApiRequest } from "next"; import { defaultResponder } from "@calcom/lib/server"; @@ -5,8 +6,6 @@ import { defaultResponder } from "@calcom/lib/server"; import { withMiddleware } from "~/lib/helpers/withMiddleware"; import { schemaUsersReadPublic } from "~/lib/validations/user"; -import { Prisma } from ".prisma/client"; - /** * @swagger * /users: