feat: create ContentsFormPage for content creation and update related imports
This commit is contained in:
parent
75e548dc83
commit
afebd8b335
@ -1,7 +1,7 @@
|
|||||||
import { z } from 'zod'
|
import { z } from 'zod'
|
||||||
|
|
||||||
import { HttpServer } from '~/libs/http-server'
|
import { HttpServer } from '~/libs/http-server'
|
||||||
import type { TContentSchema } from '~/pages/contents-create'
|
import type { TContentSchema } from '~/pages/contents-form'
|
||||||
|
|
||||||
const newsResponseSchema = z.object({
|
const newsResponseSchema = z.object({
|
||||||
data: z.object({
|
data: z.object({
|
||||||
|
|||||||
@ -55,7 +55,7 @@ export const contentSchema = z.object({
|
|||||||
|
|
||||||
export type TContentSchema = z.infer<typeof contentSchema>
|
export type TContentSchema = z.infer<typeof contentSchema>
|
||||||
|
|
||||||
export const CreateContentsPage = () => {
|
export const ContentsFormPage = () => {
|
||||||
const fetcher = useFetcher()
|
const fetcher = useFetcher()
|
||||||
const navigate = useNavigate()
|
const navigate = useNavigate()
|
||||||
const loaderData = useRouteLoaderData<typeof loader>('routes/_admin.lg-admin')
|
const loaderData = useRouteLoaderData<typeof loader>('routes/_admin.lg-admin')
|
||||||
@ -1,10 +1,10 @@
|
|||||||
import { AdminDashboardLayout } from '~/layouts/admin/dashboard'
|
import { AdminDashboardLayout } from '~/layouts/admin/dashboard'
|
||||||
import { CreateContentsPage } from '~/pages/contents-create'
|
import { ContentsFormPage } from '~/pages/contents-form'
|
||||||
|
|
||||||
const DashboardContentsLayout = () => {
|
const DashboardContentsLayout = () => {
|
||||||
return (
|
return (
|
||||||
<AdminDashboardLayout>
|
<AdminDashboardLayout>
|
||||||
<CreateContentsPage />
|
<ContentsFormPage />
|
||||||
</AdminDashboardLayout>
|
</AdminDashboardLayout>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { XiorError } from 'xior'
|
|||||||
|
|
||||||
import { createNewsRequest } from '~/apis/admin/create-news'
|
import { createNewsRequest } from '~/apis/admin/create-news'
|
||||||
import { handleCookie } from '~/libs/cookies'
|
import { handleCookie } from '~/libs/cookies'
|
||||||
import { contentSchema, type TContentSchema } from '~/pages/contents-create'
|
import { contentSchema, type TContentSchema } from '~/pages/contents-form'
|
||||||
|
|
||||||
import type { Route } from './+types/actions.register'
|
import type { Route } from './+types/actions.register'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user