fix: correct import paths for subscribe plan modules and update data table schema
This commit is contained in:
parent
0680fb4dc8
commit
0f64b4600b
@ -1,7 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
import { HttpServer, type THttpServer } from '~/libs/http-server'
|
||||
import type { TSubscribePlanSchema } from '~/pages/form-subscriptions-plan'
|
||||
import type { TSubscribePlanSchema } from '~/pages/form-subscribe-plan'
|
||||
|
||||
const subscribePlanResponseSchema = z.object({
|
||||
data: z.object({
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
import { HttpServer, type THttpServer } from '~/libs/http-server'
|
||||
import type { TSubscribePlanSchema } from '~/pages/form-subscriptions-plan'
|
||||
import type { TSubscribePlanSchema } from '~/pages/form-subscribe-plan'
|
||||
|
||||
const subscribePlanResponseSchema = z.object({
|
||||
data: z.object({
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
import { HttpServer, type THttpServer } from '~/libs/http-server'
|
||||
import type { TSubscribePlanSchema } from '~/pages/form-subscriptions-plan'
|
||||
import type { TSubscribePlanSchema } from '~/pages/form-subscribe-plan'
|
||||
|
||||
const subscribePlanResponseSchema = z.object({
|
||||
data: z.object({
|
||||
|
||||
@ -8,9 +8,9 @@ const subscriptionResponseSchema = z.object({
|
||||
id: z.string(),
|
||||
code: z.string(),
|
||||
name: z.string(),
|
||||
length: z.number().optional(),
|
||||
price: z.number().optional(),
|
||||
status: z.number().optional(),
|
||||
length: z.number(),
|
||||
price: z.number(),
|
||||
status: z.number(),
|
||||
}),
|
||||
),
|
||||
})
|
||||
|
||||
@ -15,9 +15,9 @@ export const subscribePlanSchema = z.object({
|
||||
id: z.string().optional(),
|
||||
name: z.string().min(3, 'Nama minimal 3 karakter'),
|
||||
code: z.string(),
|
||||
length: z.preprocess(Number, z.number().optional()),
|
||||
price: z.preprocess(Number, z.number().optional()),
|
||||
status: z.number().optional(),
|
||||
length: z.preprocess(Number, z.number().min(1, 'Length minimal 1')),
|
||||
price: z.preprocess(Number, z.number().min(1, 'Harga minimal 1')),
|
||||
status: z.number(),
|
||||
})
|
||||
export type TSubscribePlanSchema = z.infer<typeof subscribePlanSchema>
|
||||
type TProperties = {
|
||||
@ -36,9 +36,9 @@ export const FormSubscribePlanPage = (properties: TProperties) => {
|
||||
id: subscribePlanData?.id || undefined,
|
||||
code: subscribePlanData?.code || '',
|
||||
name: subscribePlanData?.name || '',
|
||||
length: subscribePlanData?.length || undefined,
|
||||
price: subscribePlanData?.price || undefined,
|
||||
status: subscribePlanData?.status || undefined,
|
||||
length: subscribePlanData?.length || 0,
|
||||
price: subscribePlanData?.price || 0,
|
||||
status: subscribePlanData?.status || 0,
|
||||
},
|
||||
})
|
||||
|
||||
@ -122,8 +122,8 @@ export const FormSubscribePlanPage = (properties: TProperties) => {
|
||||
/>
|
||||
<Input
|
||||
id="price"
|
||||
label="Price"
|
||||
placeholder="Masukkan Price"
|
||||
label="Harga"
|
||||
placeholder="Masukkan Harga"
|
||||
type="number"
|
||||
name="price"
|
||||
className="border-0 bg-white shadow read-only:bg-gray-100 focus:ring-1 focus:ring-[#2E2F7C] focus:outline-none"
|
||||
@ -1,4 +1,4 @@
|
||||
import { FormSubscribePlanPage } from '~/pages/form-subscriptions-plan'
|
||||
import { FormSubscribePlanPage } from '~/pages/form-subscribe-plan'
|
||||
|
||||
const DashboardSubscribePlanCreateLayout = () => <FormSubscribePlanPage />
|
||||
export default DashboardSubscribePlanCreateLayout
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { isRouteErrorResponse } from 'react-router'
|
||||
|
||||
import { getSubscriptions } from '~/apis/common/get-subscriptions'
|
||||
import { FormSubscribePlanPage } from '~/pages/form-subscriptions-plan'
|
||||
import { FormSubscribePlanPage } from '~/pages/form-subscribe-plan'
|
||||
|
||||
import type { Route } from './+types/_admin.lg-admin._dashboard.subscribe-plan.update.$id'
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import { handleCookie } from '~/libs/cookies'
|
||||
import {
|
||||
subscribePlanSchema,
|
||||
type TSubscribePlanSchema,
|
||||
} from '~/pages/form-subscriptions-plan'
|
||||
} from '~/pages/form-subscribe-plan'
|
||||
|
||||
import type { Route } from './+types/actions.admin.subscribe-plan.create'
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import { handleCookie } from '~/libs/cookies'
|
||||
import {
|
||||
subscribePlanSchema,
|
||||
type TSubscribePlanSchema,
|
||||
} from '~/pages/form-subscriptions-plan'
|
||||
} from '~/pages/form-subscribe-plan'
|
||||
|
||||
import type { Route } from './+types/actions.admin.subscribe-plan.update'
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user