@bjsdistribution/dms-client-return 0.1.33-prod → 0.1.34-prod
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/dist/dms-client-return.cjs.development.js +37 -11
- package/dist/dms-client-return.cjs.development.js.map +1 -1
- package/dist/dms-client-return.cjs.production.min.js +1 -1
- package/dist/dms-client-return.cjs.production.min.js.map +1 -1
- package/dist/dms-client-return.esm.js +37 -11
- package/dist/dms-client-return.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/order-view/order-actions/index.tsx +31 -13
package/package.json
CHANGED
|
@@ -34,6 +34,7 @@ import ChargeLog from './actions/charge-log';
|
|
|
34
34
|
import ReminderModal from './actions/create-task-reminder';
|
|
35
35
|
import TaskModal from './actions/create-task-reminder/TaskModal';
|
|
36
36
|
import ForceDebriefModal from './actions/force-debrief/ForceDebriefModal';
|
|
37
|
+
import { useNavigate } from 'react-router-dom';
|
|
37
38
|
|
|
38
39
|
function OrderActions() {
|
|
39
40
|
const [currentAction, setCurrentAction] = useCurrentAction();
|
|
@@ -47,6 +48,7 @@ function OrderActions() {
|
|
|
47
48
|
const [, setLoading] = useLoading();
|
|
48
49
|
const [, setTasksData] = useTasksData();
|
|
49
50
|
const [, setReminderNotifyData] = useReminderNotiData();
|
|
51
|
+
const navigate = useNavigate();
|
|
50
52
|
|
|
51
53
|
// call orders api
|
|
52
54
|
|
|
@@ -58,19 +60,35 @@ function OrderActions() {
|
|
|
58
60
|
});
|
|
59
61
|
|
|
60
62
|
useEffect(() => {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
63
|
+
const fetchData = async () => {
|
|
64
|
+
try {
|
|
65
|
+
setLoading(loading);
|
|
66
|
+
|
|
67
|
+
if (fetchedData && fetchedData?.data) {
|
|
68
|
+
const requiredData = fetchedData?.data;
|
|
69
|
+
setOrderDetails(requiredData[0]);
|
|
70
|
+
setPrevOrderDetails(requiredData[0]);
|
|
71
|
+
setCurrentAction(undefined);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (
|
|
75
|
+
(fetchedData && fetchedData?.data === null) ||
|
|
76
|
+
fetchedData?.data?.length === 0
|
|
77
|
+
) {
|
|
78
|
+
setCurrentAction(undefined);
|
|
79
|
+
}
|
|
80
|
+
} catch (error) {
|
|
81
|
+
//@ts-ignore
|
|
82
|
+
|
|
83
|
+
if (error?.response?.status === 404) {
|
|
84
|
+
navigate('/404');
|
|
85
|
+
} else {
|
|
86
|
+
console.error('Error fetching order data:', error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
fetchData();
|
|
74
92
|
}, [loading]);
|
|
75
93
|
|
|
76
94
|
// orders api ends
|