This commit is contained in:
Leo Giovanetti 2023-06-14 12:01:38 -03:00
parent 4b295a45d4
commit 5e780fd3d0
6 changed files with 6 additions and 6 deletions

View File

@ -46,7 +46,7 @@ export async function getServerSession(options: {
return cachedSession;
}
const user = await prisma.user.findFirst({
const user = await prisma.user.findUnique({
where: {
email: token.email.toLowerCase(),
},

View File

@ -18,7 +18,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
const {
data: { org: slug },
} = parsedQuery;
if (!slug) if (!slug) return res.status(400).json({ message: "Org is needed" });
if (!slug) return res.status(400).json({ message: "Org is needed" });
const org = await prisma.team.findFirst({ where: { slug }, select: { children: true, metadata: true } });

View File

@ -31,7 +31,7 @@ export const isSAMLAdmin = (email: string) => {
};
export const samlTenantProduct = async (prisma: PrismaClient, email: string) => {
const user = await prisma.user.findFirst({
const user = await prisma.user.findUnique({
where: {
email,
},

View File

@ -8,7 +8,7 @@ export const WEBAPP_URL =
RAILWAY_STATIC_URL ||
HEROKU_URL ||
RENDER_URL ||
"http:/localhost:3000";
"http://localhost:3000";
/** @deprecated use `WEBAPP_URL` */
export const BASE_URL = WEBAPP_URL;
export const WEBSITE_URL = process.env.NEXT_PUBLIC_WEBSITE_URL || "https://cal.com";

View File

@ -20,7 +20,7 @@ type DeleteMeOptions = {
export const deleteMeHandler = async ({ ctx, input }: DeleteMeOptions) => {
// Check if input.password is correct
const user = await prisma.user.findFirst({
const user = await prisma.user.findUnique({
where: {
email: ctx.user.email.toLowerCase(),
},

View File

@ -50,7 +50,7 @@ const vercelCreateDomain = async (domain: string) => {
export const createHandler = async ({ input }: CreateOptions) => {
const { slug, name, adminEmail, adminUsername, check } = input;
const userCollisions = await prisma.user.findFirst({
const userCollisions = await prisma.user.findUnique({
where: {
email: adminEmail,
},