Revert "context/order: add masterId"
This reverts commit d5d07d7b2f5b6673a621a30b00ad087c60675a3f.
This commit is contained in:
parent
d5d07d7b2f
commit
8931dfc69f
@ -4,11 +4,9 @@ import { createContext, type PropsWithChildren, useMemo, useReducer, useState }
|
||||
type Action = { payload: Steps; type: 'SET_STEP' } | { type: 'NEXT_STEP' };
|
||||
|
||||
type ContextType = {
|
||||
clientId: null | string;
|
||||
masterId: null | string;
|
||||
customerId: null | string;
|
||||
nextStep: () => void;
|
||||
setClientId: (clientId: string) => void;
|
||||
setMasterId: (masterId: string) => void;
|
||||
setCustomerId: (customerId: string) => void;
|
||||
setStep: (step: Steps) => void;
|
||||
step: Steps;
|
||||
};
|
||||
@ -54,22 +52,18 @@ function useStep() {
|
||||
export const OrderContext = createContext<ContextType>({} as ContextType);
|
||||
|
||||
export function OrderContextProvider({ children }: Readonly<PropsWithChildren>) {
|
||||
const { customerId: clientId, setCustomerId: setClientId } = useCustomerState();
|
||||
const { customerId: masterId, setCustomerId: setMasterId } = useCustomerState();
|
||||
|
||||
const { customerId, setCustomerId } = useCustomerState();
|
||||
const { nextStep, setStep, step } = useStep();
|
||||
|
||||
const value = useMemo(
|
||||
() => ({
|
||||
clientId,
|
||||
masterId,
|
||||
customerId,
|
||||
nextStep,
|
||||
setClientId,
|
||||
setMasterId,
|
||||
setCustomerId,
|
||||
setStep,
|
||||
step,
|
||||
}),
|
||||
[clientId, masterId, nextStep, setClientId, setMasterId, setStep, step],
|
||||
[customerId, nextStep, setCustomerId, setStep, step],
|
||||
);
|
||||
|
||||
return <OrderContext.Provider value={value}>{children}</OrderContext.Provider>;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user