Phantom
Phantom
Explore posts from servers
HHono
Created by Phantom on 3/2/2025 in #help
Update the default validator to return custom error response
hey guys, I want to update the default zValidator of hono to return custom error objects. Right now, it returns something like this:
{
"success": false,
"error": {
"issues": [
{
"validation": "email",
"code": "invalid_string",
"message": "Invalid email",
"path": [
"email"
]
}
],
"name": "ZodError"
}
}
{
"success": false,
"error": {
"issues": [
{
"validation": "email",
"code": "invalid_string",
"message": "Invalid email",
"path": [
"email"
]
}
],
"name": "ZodError"
}
}
but I want it to return {message:"message"}
35 replies
DTDrizzle Team
Created by Phantom on 1/4/2025 in #help
Drizzle not creating enum
Hey guys, I am using drizzle in my project with postgres. I create a new enum(with pgenum) but the generate sql is missing the definition of the enum.
const status = pgEnum('status', [
'created',
'generating',
'generated',
'error',
]);
const status = pgEnum('status', [
'created',
'generating',
'generated',
'error',
]);
and using this as status: status().notNull().default('created') and here's the generated sql
CREATE TABLE "curriculums" (
"id" varchar PRIMARY KEY NOT NULL,
"user_id" varchar NOT NULL,
"language_id" varchar NOT NULL,
"created_at" varchar DEFAULT now() NOT NULL,
"status" "status" DEFAULT 'created' NOT NULL,
"reason" varchar DEFAULT '' NOT NULL,
"knowledge" varchar DEFAULT '' NOT NULL
);
CREATE TABLE "curriculums" (
"id" varchar PRIMARY KEY NOT NULL,
"user_id" varchar NOT NULL,
"language_id" varchar NOT NULL,
"created_at" varchar DEFAULT now() NOT NULL,
"status" "status" DEFAULT 'created' NOT NULL,
"reason" varchar DEFAULT '' NOT NULL,
"knowledge" varchar DEFAULT '' NOT NULL
);
there's no definition of enum
20 replies
TTCTheo's Typesafe Cult
Created by Phantom on 11/24/2024 in #questions
`uploadFiles` promise not resolving
I am using uploadFiles function to upload files client side but the promise is not resolving. The uploadthing dashboard is showing status as Uploading
2 replies
DTDrizzle Team
Created by Phantom on 8/10/2023 in #help
Syntax Error and missing fields when pulling schema.
2 replies