diff --git a/app/routes/admin/route.tsx b/app/routes/admin/route.tsx index c7becaa..4fcbb15 100644 --- a/app/routes/admin/route.tsx +++ b/app/routes/admin/route.tsx @@ -1,4 +1,3 @@ -import { UserType } from "@prisma/client"; import type { ActionFunctionArgs, LoaderFunctionArgs } from "@remix-run/node"; import { json, redirect } from "@remix-run/node"; import { Form, Link, useActionData, useLoaderData } from "@remix-run/react"; @@ -82,7 +81,7 @@ export async function action({ request }: ActionFunctionArgs) { return json({ error: "Username and password are required." }); } - const normalizedType = type === UserType.Admin || type === UserType.Scanner ? type : UserType.User; + const normalizedType = (type === "Admin" || type === "Scanner") ? type : "User"; try { await dbe.user.create({ @@ -201,10 +200,10 @@ export default function AdminRoute() { Role - - - - + + + +