Skip to content

Commit

Permalink
Update prisma client imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DinerIsmail committed Oct 24, 2024
1 parent 5648c5f commit e004c82
Show file tree
Hide file tree
Showing 20 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion app/[subdomain]/[slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import truncate from 'lodash/truncate'
import type { Listing as ListingType } from '@prisma/client'
import prisma from '../../../prisma/client'
import prisma from '@prisma-rw'
import { exclude } from '@helpers/utils'
import Listing from './Listing'

Expand Down
2 changes: 1 addition & 1 deletion app/[subdomain]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import prisma from '../../prisma/client'
import prisma from '@prisma-rw'
import Web, { CENTRAL_NODE_ID } from './Web'

export default async function WebPage({ params }) {
Expand Down
2 changes: 1 addition & 1 deletion app/api/categories/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import prisma from '../../../../prisma/client'
import prisma from '@prisma-rw'

export async function DELETE(_request: Request, { params }) {
const id = params.id
Expand Down
2 changes: 1 addition & 1 deletion app/api/categories/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Category } from '@prisma/client'
import prisma from '../../../prisma/client'
import prisma from '@prisma-rw'

export async function GET(request) {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/api/listings/[slug]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Prisma } from '@prisma/client'
import uploadImage from '@helpers/uploadImage'
import deleteImage from '@helpers/deleteImage'
import { stringToBoolean } from '@helpers/utils'
import prisma from '../../../../prisma/client'
import prisma from '@prisma-rw'

function exclude(data, keys) {
return Object.fromEntries(
Expand Down
2 changes: 1 addition & 1 deletion app/api/listings/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Prisma } from '@prisma/client'
import { auth } from '@auth'
import prisma from '../../../prisma/client'
import prisma from '@prisma-rw'
import uploadImage from '@helpers/uploadImage'
import { stringToBoolean } from '@helpers/utils'
import ListingProposedEmail from '@components/emails/ListingProposedEmail'
Expand Down
2 changes: 1 addition & 1 deletion app/api/ownerships/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { auth } from '@auth'
import prisma from '../../../prisma/client'
import prisma from '@prisma-rw'

export async function GET(request) {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/api/permissions/[webSlug]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { auth } from '@auth'
import prisma from '../../../../prisma/client'
import prisma from '@prisma-rw'

export async function GET(_request, { params }) {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/api/permissions/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { auth } from '@auth'
import prisma from '../../../prisma/client'
import prisma from '@prisma-rw'

export async function GET(request) {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/api/tags/[id]/listings/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import prisma from '../../../../../prisma/client'
import prisma from '@prisma-rw'

export async function PUT(request: Request, { params }) {
const id = params.id
Expand Down
2 changes: 1 addition & 1 deletion app/api/tags/[id]/route.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import prisma from '../../../../prisma/client'
import prisma from '@prisma-rw'

export async function DELETE(_request: Request, { params }) {
const id = params.id
Expand Down
2 changes: 1 addition & 1 deletion app/api/tags/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tag } from '@prisma/client'
import prisma from '../../../prisma/client'
import prisma from '@prisma-rw'

export async function GET(request) {
try {
Expand Down
2 changes: 1 addition & 1 deletion app/api/users/invite/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sgMail from '@sendgrid/mail'
import { render } from '@react-email/render'
import { Prisma } from '@prisma/client'
import { auth } from '@auth'
import prisma from '../../../../prisma/client'
import prisma from '@prisma-rw'
import { REMOTE_URL } from '@helpers/config'
import InviteEmail from '@components/emails/InviteEmail'

Expand Down
2 changes: 1 addition & 1 deletion app/api/users/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import client from '@sendgrid/client'
import { auth } from '@auth'
import prisma from '../../../prisma/client'
import prisma from '@prisma-rw'

client.setApiKey(process.env.SENDGRID_API_KEY)

Expand Down
2 changes: 1 addition & 1 deletion app/api/webs/[slug]/publish/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { auth } from '@auth'
import prisma from '../../../../../prisma/client'
import prisma from '@prisma-rw'

export async function POST(_request, { params }) {
const session = await auth()
Expand Down
2 changes: 1 addition & 1 deletion app/api/webs/[slug]/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Web, Prisma } from '@prisma/client'
import prisma from '../../../../prisma/client'
import prisma from '@prisma-rw'
import uploadImage from '@helpers/uploadImage'
import { stringToBoolean } from '@helpers/utils'
import { auth } from '@auth'
Expand Down
2 changes: 1 addition & 1 deletion app/api/webs/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Prisma } from '@prisma/client'
import { auth } from '@auth'
import prisma from '../../../prisma/client'
import prisma from '@prisma-rw'
import WebCreatedEmail from '@components/emails/WebCreatedEmail'
import WebCreatedAdminEmail from '@components/emails/WebCreatedAdminEmail'
import { PROTOCOL, REMOTE_HOSTNAME } from '@helpers/config'
Expand Down
2 changes: 1 addition & 1 deletion app/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import NextAuth from 'next-auth'
import { PrismaAdapter } from '@auth/prisma-adapter'
import Sendgrid from 'next-auth/providers/sendgrid'
import nodemailer from 'nodemailer'
import prisma from '../prisma/client'
import prisma from '@prisma-rw'
import { simpleHtmlTemplate, textTemplate } from '@helpers/emailTemplates'
import config from '@helpers/config'

Expand Down
2 changes: 1 addition & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import prisma from '../prisma/client'
import prisma from '@prisma-rw'
import Homepage from './Homepage'

export const metadata = {
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
],
"@trigger/*": [
"trigger/*"
],
"@prisma-rw": [
"prisma/client"
]
},
"typeRoots": [
Expand Down

0 comments on commit e004c82

Please sign in to comment.