feat: restructure ads mgmt by creating a new layout for ads creation and updating related schemas
This commit is contained in:
@@ -10,14 +10,14 @@ import { Input } from '~/components/ui/input'
|
||||
import { TitleDashboard } from '~/components/ui/title-dashboard'
|
||||
import { urlFriendlyCode } from '~/utils/formatter'
|
||||
|
||||
export const createCategorySchema = z.object({
|
||||
export const categorySchema = z.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string().min(3, 'Nama minimal 3 karakter'),
|
||||
code: z.string(),
|
||||
sequence: z.preprocess(Number, z.number().optional()),
|
||||
description: z.string(),
|
||||
})
|
||||
export type TCategorySchema = z.infer<typeof createCategorySchema>
|
||||
export type TCategorySchema = z.infer<typeof categorySchema>
|
||||
type TProperties = {
|
||||
categoryData?: TCategoryResponse
|
||||
}
|
||||
@@ -29,7 +29,7 @@ export const FormCategoryPage = (properties: TProperties) => {
|
||||
const formMethods = useRemixForm<TCategorySchema>({
|
||||
mode: 'onSubmit',
|
||||
fetcher,
|
||||
resolver: zodResolver(createCategorySchema),
|
||||
resolver: zodResolver(categorySchema),
|
||||
values: {
|
||||
id: categoryData?.id || undefined,
|
||||
code: categoryData?.code || '',
|
||||
|
||||
Reference in New Issue
Block a user