Pull Request branch dev-clone to main #1
|
|
@ -11,6 +11,7 @@ import authInfo from "../../middlewares/authInfo";
|
|||
import { or, eq } from "drizzle-orm";
|
||||
import { z } from "zod";
|
||||
import HonoEnv from "../../types/HonoEnv";
|
||||
import { notFound } from "../../errors/DashboardError";
|
||||
|
||||
const registerFormSchema = z.object({
|
||||
name: z.string().min(1).max(255),
|
||||
|
|
@ -109,9 +110,7 @@ const respondentsRoute = new Hono<HonoEnv>()
|
|||
.where(eq(rolesSchema.code, "user"))
|
||||
.limit(1);
|
||||
|
||||
if (!role) {
|
||||
throw new HTTPException(500, { message: "Role 'user' not found" });
|
||||
}
|
||||
if (!role) throw notFound();
|
||||
|
||||
await trx.insert(rolesToUsers).values({
|
||||
userId: newUser.id,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user