TRPCClientError when creating a db entry without `updatedAt` value?

Guys, this is my prisma schema:
model User {
id Int @id @default(autoincrement())
firstName String?
lastName String?
email String @unique
phone String?
about String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model User {
id Int @id @default(autoincrement())
firstName String?
lastName String?
email String @unique
phone String?
about String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
Every time I try to create an entry, it fails because I didn't provide a value for updatedAt. How to fix?
TRPCClientError:
Invalid `prisma.user.create()` invocation:
Null constraint violation on the fields: (`updatedAt`)
TRPCClientError:
Invalid `prisma.user.create()` invocation:
Null constraint violation on the fields: (`updatedAt`)
Thanks! Using t3-app.
Solution:
this is a prisma question not a trpc one. based on the error sounds like you need to provide a value for updatedAt
Solution
T
trash369d ago
this is a prisma question not a trpc one. based on the error sounds like you need to provide a value for updatedAt
B
bassamanator369d ago
@trash_dev Interestingly enough, I'm watching your tRPC tutorial on youtube lol. Sorry about this post. Thanks!
T
trash369d ago
haha awesome! hope it’s helpful 🙂
B
bassamanator369d ago
Very, thanks!
More Posts
Type error: The inferred type of 'trpc' cannot be named without a reference....```./src/lib/api.ts:21:14 @driveorg/dashboard:build: Type error: The inferred type of 'trpc' cannot Decision on authI am using create-t3-app for my app , with next-auth (twitter, discord, google) . Now i am using samWhy does this starter with Prisma have it's own postinstall script?Prisma has it's own postinstall hook/script: <https://www.prisma.io/docs/concepts/components/prisma-Senior Full Stack Developer is Ready.✍️ Skill Set HTML/CSS/JS, TS React/Next.js, Angular/RxJs, Tailwind CSS WordPHow to pass context to vanilla client?Hi, I have a next app where I use trpc. Now I need to call some trpc functions from outside of any Is this blog correct? Trpc and next.js 13.4, App directoryI working on integrating with TRPC with the App directory and was given a solution but i'm not sure Is there a way to transform data server-side only?I'd like to implement something like Symfonys ParamConverter that converts certain params, but serveHow do I prefetch the nextPage of an infiniteQuery?I have a custom infiniteQuery hook, and I want to prefetch the next page on success. My current implis it possible to use trpc on next js api routeslike can i use trpc mutation or query on `/api/test`Dockerfile in TubrorepoHi I have a Turborepo where I have a nextjs frontend “web” and an express backend “api” both connectQuerying external api in trpc router not workingHi guys! So I'm trying to query an api endpoint that I created through a separate node server inside[HOW TO?] Call trpc endpoints from vanilla nextJs api routesSpinoff from an og thread here: https://discordapp.com/channels/867764511159091230/10323011989901353Tutorial for setting up tRPC with Next13 app dir?Anyone has a goos tutorial (blogpost / YouTube) on setting up tRPC with Next13 app dir for both clieStack trace in Client?I've just found that in production I can see stack trace for TRPCErrors. Isin't it supposed to not s