Сервер у вас на порту 4200, а клиент на другом, отсюда и проблема CORS.
app.enableCors({
origin: [process.env.CLIENT_URL],
credentials: true,
exposedHeaders: ['set-cookie'],
});
generator client {
provider = "prisma-client-js"
output = "generated/client"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
name String
lastName String
email String @unique
linkedEmail String @unique
password String
phone String
birthdate String
gender String
questions Question[]
likedQuestions Question[] @relation("LikedQuestions")
@@map("user")
}
model Question {
id String @id @default(cuid())
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
themeText String @map("theme_text")
text String? @default("")
category String
subcategory String
likes Int? @default(0)
likedBy User[] @relation("LikedQuestions")
isLeader Boolean? @default(false) @map("is_leader")
user User? @relation(fields: [userId], references: [id])
userId String?
@@map("question")
}