From 6d8e352ffcf0f85989cb3d5e11c29457fc1263b7 Mon Sep 17 00:00:00 2001 From: Ardeman Date: Tue, 4 Mar 2025 09:44:09 +0800 Subject: [PATCH] feat: refactor login handling to use staff-login page and update related imports --- app/apis/admin/login-staff.ts | 2 +- app/pages/dashboard-contents/index.tsx | 61 +++++++++++-------- .../{admin-login => staff-login}/index.tsx | 0 app/routes/_admin.lg-admin._auth.login.tsx | 2 +- app/routes/actions.admin.login.ts | 2 +- 5 files changed, 40 insertions(+), 27 deletions(-) rename app/pages/{admin-login => staff-login}/index.tsx (100%) diff --git a/app/apis/admin/login-staff.ts b/app/apis/admin/login-staff.ts index 64a8381..de7ac61 100644 --- a/app/apis/admin/login-staff.ts +++ b/app/apis/admin/login-staff.ts @@ -1,7 +1,7 @@ import { z } from 'zod' import { HttpServer } from '~/libs/http-server' -import type { TLoginSchema } from '~/pages/admin-login' +import type { TLoginSchema } from '~/pages/staff-login' const loginResponseSchema = z.object({ data: z.object({ diff --git a/app/pages/dashboard-contents/index.tsx b/app/pages/dashboard-contents/index.tsx index 3717775..fcc37af 100644 --- a/app/pages/dashboard-contents/index.tsx +++ b/app/pages/dashboard-contents/index.tsx @@ -1,6 +1,7 @@ import { Field, Input, Label, Select } from '@headlessui/react' import DT from 'datatables.net-dt' import DataTable from 'datatables.net-react' +import { Link } from 'react-router' import { SearchIcon } from '~/components/icons/search' import { Button } from '~/components/ui/button' @@ -57,33 +58,45 @@ export const ContentsPage = () => { return (
-
-
- - -
- -
- +
+
+
+ + +
+ +
+ +
-
- -
+ +
-
- - - - +
+ + + + +
+
export default AuthLayout diff --git a/app/routes/actions.admin.login.ts b/app/routes/actions.admin.login.ts index 778cb7a..f125528 100644 --- a/app/routes/actions.admin.login.ts +++ b/app/routes/actions.admin.login.ts @@ -5,7 +5,7 @@ import { XiorError } from 'xior' import { getStaff } from '~/apis/admin/get-staff' import { staffLoginRequest } from '~/apis/admin/login-staff' -import { loginSchema, type TLoginSchema } from '~/pages/admin-login' +import { loginSchema, type TLoginSchema } from '~/pages/staff-login' import { generateStaffTokenCookie } from '~/utils/token' import type { Route } from './+types/actions.login'