feat: refactor import paths for content and category schemas to improve clarity and organization

This commit is contained in:
Ardeman 2025-03-08 00:47:33 +08:00
parent 3a15c0d945
commit 2c64d430bd
11 changed files with 14 additions and 14 deletions

View File

@ -1,7 +1,7 @@
import { z } from 'zod'
import { HttpServer } from '~/libs/http-server'
import type { TCategorySchema } from '~/pages/dashboard-category-create'
import type { TCategorySchema } from '~/pages/form-category'
const categoryResponseSchema = z.object({
data: z.object({

View File

@ -1,7 +1,7 @@
import { z } from 'zod'
import { HttpServer } from '~/libs/http-server'
import type { TContentSchema } from '~/pages/contents-form'
import type { TContentSchema } from '~/pages/form-contents'
const newsResponseSchema = z.object({
data: z.object({

View File

@ -1,7 +1,7 @@
import { z } from 'zod'
import { HttpServer } from '~/libs/http-server'
import type { TContentSchema } from '~/pages/contents-form'
import type { TContentSchema } from '~/pages/form-contents'
const newsResponseSchema = z.object({
data: z.object({

View File

@ -15,7 +15,7 @@ export const createCategorySchema = z.object({
})
export type TCategorySchema = z.infer<typeof createCategorySchema>
export const CreateCategoryPage = () => {
export const FormCategoryPage = () => {
const fetcher = useFetcher()
const navigate = useNavigate()
const formMethods = useRemixForm<TCategorySchema>({

View File

@ -60,7 +60,7 @@ type TProperties = {
newsData?: z.infer<typeof newsResponseSchema>
}
export const ContentsFormPage = (properties: TProperties) => {
export const FormContentsPage = (properties: TProperties) => {
const { newsData } = properties || {}
const fetcher = useFetcher()
const navigate = useNavigate()

View File

@ -1,4 +1,4 @@
import { CreateCategoryPage } from '~/pages/dashboard-category-create'
import { FormCategoryPage } from '~/pages/form-category'
const DashboardCategoriesCreateLayout = () => <CreateCategoryPage />
const DashboardCategoriesCreateLayout = () => <FormCategoryPage />
export default DashboardCategoriesCreateLayout

View File

@ -1,4 +1,4 @@
import { ContentsFormPage } from '~/pages/contents-form'
import { FormContentsPage } from '~/pages/form-contents'
const DashboardContentCreateLayout = () => <ContentsFormPage />
const DashboardContentCreateLayout = () => <FormContentsPage />
export default DashboardContentCreateLayout

View File

@ -1,6 +1,6 @@
import { getNewsBySlug } from '~/apis/common/get-news-by-slug'
import { handleCookie } from '~/libs/cookies'
import { ContentsFormPage } from '~/pages/contents-form'
import { FormContentsPage } from '~/pages/form-contents'
import type { Route } from './+types/_admin.lg-admin._dashboard.contents.update.$slug'
@ -15,6 +15,6 @@ export const loader = async ({ request }: Route.LoaderArgs) => {
const DashboardContentUpdateLayout = ({ loaderData }: Route.ComponentProps) => {
const newsData = loaderData.newsData
return <ContentsFormPage newsData={newsData} />
return <FormContentsPage newsData={newsData} />
}
export default DashboardContentUpdateLayout

View File

@ -8,7 +8,7 @@ import { handleCookie } from '~/libs/cookies'
import {
createCategorySchema,
type TCategorySchema,
} from '~/pages/dashboard-category-create'
} from '~/pages/form-category'
import type { Route } from './+types/actions.register'

View File

@ -5,7 +5,7 @@ import { XiorError } from 'xior'
import { createNewsRequest } from '~/apis/admin/create-news'
import { handleCookie } from '~/libs/cookies'
import { contentSchema, type TContentSchema } from '~/pages/contents-form'
import { contentSchema, type TContentSchema } from '~/pages/form-contents'
import type { Route } from './+types/actions.register'

View File

@ -5,7 +5,7 @@ import { XiorError } from 'xior'
import { updateNewsRequest } from '~/apis/admin/update-news'
import { handleCookie } from '~/libs/cookies'
import { contentSchema, type TContentSchema } from '~/pages/contents-form'
import { contentSchema, type TContentSchema } from '~/pages/form-contents'
import type { Route } from './+types/actions.register'