feat(order): enhance order initialization logic with additional client selection step
- Added a new step for client selection in the order initialization process when only a masterId is present. - Disabled cognitive complexity checks for improved code maintainability.
This commit is contained in:
parent
c9a4c23564
commit
4e37146214
@ -1,3 +1,4 @@
|
||||
/* eslint-disable sonarjs/cognitive-complexity */
|
||||
'use client';
|
||||
import { useOrderStore } from './context';
|
||||
import { type Steps } from './types';
|
||||
@ -45,6 +46,8 @@ export function useInitOrderStore(initData: null | OrderFieldsFragment) {
|
||||
setStep('datetime-select');
|
||||
} else if (masterId && clientId) {
|
||||
setStep('service-select');
|
||||
} else if (masterId) {
|
||||
setStep('client-select');
|
||||
} else {
|
||||
setStep(UNIFIED_STEPS[0] ?? 'loading');
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user