From 8931dfc69f52e5193fd1f1f48ad7a8fa7a3a08de Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 12 Mar 2025 16:53:04 +0300 Subject: [PATCH] Revert "context/order: add masterId" This reverts commit d5d07d7b2f5b6673a621a30b00ad087c60675a3f. --- apps/web/context/order.tsx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/apps/web/context/order.tsx b/apps/web/context/order.tsx index 6052f4f..b37eb6d 100644 --- a/apps/web/context/order.tsx +++ b/apps/web/context/order.tsx @@ -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({} as ContextType); export function OrderContextProvider({ children }: Readonly) { - 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 {children};