fix
This commit is contained in:
@@ -37,15 +37,19 @@ import { Skeleton } from '@repo/ui/components/skeleton'
|
||||
type WizardState = {
|
||||
index: number
|
||||
kind: 'bulk' | 'assigned'
|
||||
cart: any
|
||||
payment: any
|
||||
items?: object[]
|
||||
coupon?: object
|
||||
enrollments?: object[]
|
||||
payment?: any
|
||||
}
|
||||
|
||||
const emptyWizard: WizardState = {
|
||||
index: 0,
|
||||
kind: 'bulk',
|
||||
cart: {},
|
||||
payment: {}
|
||||
items: undefined,
|
||||
coupon: undefined,
|
||||
enrollments: undefined,
|
||||
payment: undefined
|
||||
}
|
||||
|
||||
export function meta({}: Route.MetaArgs) {
|
||||
@@ -80,12 +84,12 @@ export default function Route({
|
||||
const index = state.index
|
||||
const kind = state.kind
|
||||
const props = {
|
||||
...state,
|
||||
courses,
|
||||
defaultValues: state.cart,
|
||||
onSubmit: async (data: any) =>
|
||||
setState((prev) => ({
|
||||
...(prev ?? emptyWizard),
|
||||
cart: data
|
||||
...data
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user