@bjsdistribution/dms-client-return 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.13",
2
+ "version": "0.0.15",
3
3
  "license": "MIT",
4
4
  "main": "dist/index.js",
5
5
  "typings": "dist/index.d.ts",
@@ -73,7 +73,7 @@ function OrderView() {
73
73
  const paths = splitPath(location.pathname);
74
74
  const [, setLocationOptions] = useLocationOptions();
75
75
  const [apiCalling] = useApiCalling();
76
-
76
+ console.log(paths, 'paths');
77
77
  const [orderResources, setOrderResources] = useOrderProductsResources();
78
78
  const [orderToolbox, setOrderToolbox] = useOrderProductsToolbox();
79
79
  const [GsitCUstomerId, setGsitCUstomerId] = useGsitCUstomerId();
@@ -138,7 +138,7 @@ function OrderView() {
138
138
 
139
139
  useEffect(() => {
140
140
  if (paths.length > 1) {
141
- setOrderId(paths[1]);
141
+ setOrderId(paths[2]);
142
142
  }
143
143
  // for local
144
144
  // if (paths.length >= 0) {
@@ -16,7 +16,7 @@ const CreateReturnModal = () => {
16
16
  const [selectedReturnOrder] = useSelectedOrders();
17
17
  const [load] = usePostLoading();
18
18
  const [groupedPayload] = useGroupedPayload();
19
- const [forDisabledCheck] = useSelectedConfirmLoc();
19
+ // const [forDisabledCheck] = useSelectedConfirmLoc();
20
20
  const [, setNew] = useFinalPayload();
21
21
 
22
22
  const handleSelectLocations = (id: number) => {
@@ -42,9 +42,9 @@ const CreateReturnModal = () => {
42
42
  }, []);
43
43
 
44
44
  useEffect(() => {
45
- if (groupedPayload?.length > 0 && forDisabledCheck?.length > 0) {
45
+ if (groupedPayload?.length > 0 && selectedlocation?.length > 0) {
46
46
  const matchedItems = groupedPayload?.filter((item: any) =>
47
- forDisabledCheck.includes(item.id)
47
+ selectedlocation.includes(item.id)
48
48
  );
49
49
 
50
50
  if (matchedItems.length > 0) {
@@ -52,7 +52,7 @@ const CreateReturnModal = () => {
52
52
  setNew(finalPayload);
53
53
  }
54
54
  }
55
- }, [forDisabledCheck]);
55
+ }, [selectedlocation]);
56
56
 
57
57
  return (
58
58
  <>
@@ -251,7 +251,7 @@ function useUpdateOrderProducts() {
251
251
  const CallAPi = atom(false);
252
252
 
253
253
  export function useCallAPi() {
254
- return useAtom(CallAPi);
254
+ return useAtom(CallAPi);
255
255
  }
256
256
  // export const selectedProductIdAtom = atom<number | null>(null);
257
257
 
@@ -328,12 +328,11 @@ const returnAfterOrderAtom = atom<any[]>([]);
328
328
 
329
329
  export function useReturnAfterOrderData() {
330
330
  return useAtom(returnAfterOrderAtom);
331
- }
332
- const clientDataAtom = atom<ClientData[]>([]);
333
- function useClientData() {
334
- return useAtom(clientDataAtom);
335
- }
336
-
331
+ }
332
+ const clientDataAtom = atom<ClientData[]>([]);
333
+ function useClientData() {
334
+ return useAtom(clientDataAtom);
335
+ }
337
336
 
338
337
  export {
339
338
  useAtom,
@@ -355,7 +354,7 @@ export {
355
354
  useEventNotesData,
356
355
  useSelectedProductId,
357
356
  useSelectedProductActionTabKey,
358
- useClientData
357
+ useClientData,
359
358
  };
360
359
 
361
360
  const NotesLoading = atom<boolean>(true);
@@ -428,13 +427,13 @@ export function useOrderProductId() {
428
427
  const returnDataAtom = atom<any[]>([]);
429
428
  export function useReturnData() {
430
429
  return useAtom(returnDataAtom);
431
- }
432
- const apiCalling = atom<boolean>(false);
430
+ }
431
+ const apiCalling = atom<boolean>(false);
433
432
 
434
- export function useApiCalling() {
435
- return useAtom(apiCalling);
436
- }
437
- const liveRecalling = atom<boolean>(false);
433
+ export function useApiCalling() {
434
+ return useAtom(apiCalling);
435
+ }
436
+ const liveRecalling = atom<boolean>(false);
438
437
 
439
438
  //re api call of live status
440
439
  export function useLiveRecalling() {
@@ -449,14 +448,18 @@ export const letselectedProductIdAtom = atom<number | null>(null);
449
448
  // };
450
449
 
451
450
  const auditLogToggle = atom<boolean>(true);
452
- export const SeteauditLogToggle= () => {
451
+ export const SeteauditLogToggle = () => {
453
452
  return useAtom(auditLogToggle);
454
453
  };
455
454
 
456
-
457
455
  // Popup state Manage
458
456
  const initialState = null;
457
+
459
458
  const popupReducer = (state: any, action: any) => {
459
+ if (action.type === 'create-return') {
460
+ state = 'create-return';
461
+ return { state };
462
+ }
460
463
  if (action.type === 'bulkUpdate') {
461
464
  state = 'bulkUpdate';
462
465
  return { state };