Formated Files

This commit is contained in:
Ahmad 2024-02-15 20:49:19 -05:00
parent d5631b309a
commit e768d9181f
No known key found for this signature in database
GPG key ID: 8FD8A93530D182BF
138 changed files with 1829 additions and 1851 deletions

View file

@ -1,7 +1,7 @@
import { auth, currentUser } from "@clerk/nextjs";
import { ACTION, ENTITY_TYPE } from "@prisma/client";
import { auth, currentUser } from '@clerk/nextjs';
import { ACTION, ENTITY_TYPE } from '@prisma/client';
import { db } from "@/lib/db";
import { db } from '@/lib/db';
interface Props {
entityId: string;
@ -15,7 +15,7 @@ export const createAuditLog = async (props: Props) => {
const { orgId } = auth();
const user = await currentUser();
if (!orgId || !user) throw new Error("User not found");
if (!orgId || !user) throw new Error('User not found');
const { entityId, entityType, entityTitle, action } = props;
@ -28,10 +28,10 @@ export const createAuditLog = async (props: Props) => {
action,
userId: user.id,
userImage: user?.imageUrl,
userName: user?.firstName + " " + user?.lastName,
userName: user?.firstName + ' ' + user?.lastName,
},
});
} catch (error) {
console.error("[AUDIT_LOG_ERROR]", error);
console.error('[AUDIT_LOG_ERROR]', error);
}
};

View file

@ -1,4 +1,4 @@
import { z } from "zod";
import { z } from 'zod';
export type FieldErrors<T> = {
[K in keyof T]?: string[];

View file

@ -1,4 +1,4 @@
import { PrismaClient } from "@prisma/client";
import { PrismaClient } from '@prisma/client';
declare global {
var prisma: PrismaClient | undefined;
@ -6,4 +6,4 @@ declare global {
export const db = globalThis.prisma ?? new PrismaClient();
if (process.env.NODE_ENV !== "production") globalThis.prisma = db;
if (process.env.NODE_ENV !== 'production') globalThis.prisma = db;

View file

@ -1 +1 @@
export const fetcher = (url: string) => fetch(url).then((res) => res.json())
export const fetcher = (url: string) => fetch(url).then((res) => res.json());

View file

@ -1,4 +1,4 @@
import { ACTION, AuditLog } from "@prisma/client";
import { ACTION, AuditLog } from '@prisma/client';
export const generateLogMessage = (log: AuditLog) => {
const { action, entityTitle, entityType } = log;

View file

@ -1,13 +1,13 @@
import { auth } from "@clerk/nextjs";
import { auth } from '@clerk/nextjs';
import { db } from "@/lib/db";
import { MAX_FREE_BOARDS } from "@/constants/boards";
import { db } from '@/lib/db';
import { MAX_FREE_BOARDS } from '@/constants/boards';
export const incrementAvailableCount = async () => {
const { orgId } = auth();
if (!orgId) {
throw new Error("Unauthorized");
throw new Error('Unauthorized');
}
const orgLimit = await db.orgLimit.findUnique({
@ -30,7 +30,7 @@ export const decreaseAvailableCount = async () => {
const { orgId } = auth();
if (!orgId) {
throw new Error("Unauthorized");
throw new Error('Unauthorized');
}
const orgLimit = await db.orgLimit.findUnique({
@ -53,7 +53,7 @@ export const hasAvailableCount = async () => {
const { orgId } = auth();
if (!orgId) {
throw new Error("Unauthorized");
throw new Error('Unauthorized');
}
const orgLimit = await db.orgLimit.findUnique({

View file

@ -1,6 +1,6 @@
import Stripe from "stripe";
import Stripe from 'stripe';
export const stripe = new Stripe(process.env.STRIPE_API_KEY!, {
apiVersion: "2023-10-16",
apiVersion: '2023-10-16',
typescript: true,
});

View file

@ -1,6 +1,6 @@
import { auth } from "@clerk/nextjs";
import { auth } from '@clerk/nextjs';
import { db } from "@/lib/db";
import { db } from '@/lib/db';
const DAY_IN_MS = 86_400_000;

View file

@ -1,6 +1,6 @@
import { createApi } from "unsplash-js";
import { createApi } from 'unsplash-js';
export const unsplash = createApi({
accessKey: process.env.NEXT_PUBLIC_UNSPLASH_ACCESS_KEY!,
fetch: fetch,
});
});

View file

@ -1,10 +1,10 @@
import { type ClassValue, clsx } from "clsx"
import { twMerge } from "tailwind-merge"
import { type ClassValue, clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
return twMerge(clsx(inputs));
}
export function absoluteUrl(pathname: string) {
return `${process.env.NEXT_PUBLIC_APP_URL}${pathname}`
return `${process.env.NEXT_PUBLIC_APP_URL}${pathname}`;
}