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