Prisma erros
Unanswered
Asian black bear posted this in #help-forum
Asian black bearOP
import dbConnect from '@/lib/mongoose';
import { NextRequest, NextResponse } from 'next/server';
import { PrismaClient } from '@prisma/client'
const prisma = new PrismaClient({})
export async function GET() {
const returnUser = await prisma.prods.findFirst({
where: {
guild: "1226340283210535034",
},
})
console.log(returnUser?.ban)
return NextResponse.json({ message: "Hellow world" }, { status: 200 });
}
// prisma/schema.prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "mongodb"
url = env("MONGODB_URI")
}
model prods {
id String @id @map("_id") @default(auto()) @db.ObjectId
data Json?
}
model Message {
id String @id @map("_id")
message String
}
1 Reply
Asian black bearOP
Error converting field "verification" of expected non-nullable type "Json", found incompatible value of "null".