eleven-solutions-common-website-unique-web 4.0.15 → 4.0.16
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.
@@ -80,29 +80,15 @@ const TaxonomyForm = () => {
|
|
80
80
|
setIsSimilarTaxonomyOpen(true);
|
81
81
|
}
|
82
82
|
}, []);
|
83
|
-
// useEffect(() => {
|
84
|
-
// const handleLocationChange = () => {
|
85
|
-
// if (window.location.pathname === "/taxonomy/taxonomyform") {
|
86
|
-
// setIsSimilarTaxonomyOpen(true);
|
87
|
-
// }
|
88
|
-
// else {
|
89
|
-
// setIsSimilarTaxonomyOpen(false);
|
90
|
-
// }
|
91
|
-
// };
|
92
|
-
// handleLocationChange();
|
93
|
-
// window.addEventListener("popstate", handleLocationChange);
|
94
|
-
// return () => {
|
95
|
-
// window.removeEventListener("popstate", handleLocationChange);
|
96
|
-
// };
|
97
|
-
// }, []);
|
98
83
|
const handleSubmit = (event) => __awaiter(void 0, void 0, void 0, function* () {
|
99
84
|
event.preventDefault();
|
100
|
-
|
85
|
+
if (!validateForm())
|
86
|
+
return;
|
101
87
|
try {
|
102
88
|
if (isEditMode) {
|
103
89
|
yield addMultipleTaxonomiesApi(tempTaxonomy);
|
104
90
|
setTempTaxonomy([]);
|
105
|
-
alert("Taxonomies
|
91
|
+
alert("Taxonomies saved successfully");
|
106
92
|
}
|
107
93
|
else {
|
108
94
|
yield addTaxonomyApi(inputType, Number(code), value);
|
package/package.json
CHANGED
@@ -112,34 +112,15 @@ const TaxonomyForm = () => {
|
|
112
112
|
}
|
113
113
|
}, []);
|
114
114
|
|
115
|
-
// useEffect(() => {
|
116
|
-
// const handleLocationChange = () => {
|
117
|
-
// if (window.location.pathname === "/taxonomy/taxonomyform") {
|
118
|
-
// setIsSimilarTaxonomyOpen(true);
|
119
|
-
// }
|
120
|
-
// else {
|
121
|
-
// setIsSimilarTaxonomyOpen(false);
|
122
|
-
// }
|
123
|
-
// };
|
124
|
-
|
125
|
-
// handleLocationChange();
|
126
|
-
|
127
|
-
// window.addEventListener("popstate", handleLocationChange);
|
128
|
-
|
129
|
-
// return () => {
|
130
|
-
// window.removeEventListener("popstate", handleLocationChange);
|
131
|
-
// };
|
132
|
-
// }, []);
|
133
|
-
|
134
115
|
const handleSubmit = async (event: React.MouseEvent<HTMLButtonElement>) => {
|
135
116
|
event.preventDefault();
|
136
|
-
|
117
|
+
if (!validateForm()) return;
|
137
118
|
|
138
119
|
try {
|
139
120
|
if (isEditMode) {
|
140
121
|
await addMultipleTaxonomiesApi(tempTaxonomy);
|
141
122
|
setTempTaxonomy([]);
|
142
|
-
alert("Taxonomies
|
123
|
+
alert("Taxonomies saved successfully");
|
143
124
|
} else {
|
144
125
|
await addTaxonomyApi(inputType, Number(code), value);
|
145
126
|
alert("Taxonomy added successfully");
|