trash
trash
Explore posts from servers
TTCTheo's Typesafe Cult
Created by trash on 6/10/2023 in #questions
how do i prisma
given this model
model Vote {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId String
challenge Challenge? @relation(fields: [challengeId], references: [id])
challengeId Int?
solution Solution? @relation(fields: [solutionId], references: [id])
solutionId Int?

@@index([userId])
@@index([challengeId])
@@index([solutionId])
}
model Vote {
id Int @id @default(autoincrement())
user User @relation(fields: [userId], references: [id])
userId String
challenge Challenge? @relation(fields: [challengeId], references: [id])
challengeId Int?
solution Solution? @relation(fields: [solutionId], references: [id])
solutionId Int?

@@index([userId])
@@index([challengeId])
@@index([solutionId])
}
i am executing this create
await prisma.vote.create({
data: {
challengeId,
userId,
}
});
await prisma.vote.create({
data: {
challengeId,
userId,
}
});
which results in this error
Argument `user` is missing.
- error Error:
Invalid `prisma.vote.create()` invocation:

{
data: {
challengeId: 3,
userId: "bdc8a494-9d98-474d-bbe5-b069d934c49b",
+ user: {
+ create: UserCreateWithoutVoteInput | UserUncheckedCreateWithoutVoteInput,
+ connectOrCreate: UserCreateOrConnectWithoutVoteInput,
+ connect: UserWhereUniqueInput
+ }
}
}
Argument `user` is missing.
- error Error:
Invalid `prisma.vote.create()` invocation:

{
data: {
challengeId: 3,
userId: "bdc8a494-9d98-474d-bbe5-b069d934c49b",
+ user: {
+ create: UserCreateWithoutVoteInput | UserUncheckedCreateWithoutVoteInput,
+ connectOrCreate: UserCreateOrConnectWithoutVoteInput,
+ connect: UserWhereUniqueInput
+ }
}
}
the userId and challengeId are both valid seems like this should work?
16 replies
RRailway
Created by trash on 6/8/2023 in #✋|help
mongo instance started returning pool destroyed
hello, i've had this instance running for a while now and noticed its down. i saw a spike in traffic so i am guessing it is due to that. i tried to restart but it said there was an error trying to restart. any guidance here as i have users trying to access. thanks!
75 replies