eleven-solutions-common-website-unique-web 3.0.36 → 3.0.38
Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@ const TaxonomyForm = () => {
|
|
25
25
|
const [editTaxonomyItem, setEditTaxonomyItem] = useState(null);
|
26
26
|
const [editTempTaxonomyItem, setEditTempTaxonomyItem] = useState(null);
|
27
27
|
const [selectedTaxonomyId, setSelectedTaxonomyId] = useState("");
|
28
|
-
const [isMultiple, setIsMultiple] = useState(
|
28
|
+
const [isMultiple, setIsMultiple] = useState(false);
|
29
29
|
const validateForm = () => {
|
30
30
|
if (!type || !code || !value) {
|
31
31
|
alert("Please fill in all required fields: Type, Code, and Value.");
|
@@ -137,17 +137,6 @@ const TaxonomyForm = () => {
|
|
137
137
|
alert("Failed to add/update Taxonomy");
|
138
138
|
}
|
139
139
|
});
|
140
|
-
// useEffect(() => {
|
141
|
-
// const fetchIsMultiple = async () => {
|
142
|
-
// try {
|
143
|
-
// const result = await isMultipleApi(type);
|
144
|
-
// setIsMultiple(typeof result === "boolean");
|
145
|
-
// } catch (error) {
|
146
|
-
// console.error("Error checking if taxonomy is multiple:", error);
|
147
|
-
// }
|
148
|
-
// };
|
149
|
-
// fetchIsMultiple();
|
150
|
-
// }, [type]);
|
151
140
|
useEffect(() => {
|
152
141
|
const fetchIsMultiple = () => __awaiter(void 0, void 0, void 0, function* () {
|
153
142
|
try {
|
@@ -158,17 +147,28 @@ const TaxonomyForm = () => {
|
|
158
147
|
console.error("Error checking if taxonomy is multiple:", error);
|
159
148
|
}
|
160
149
|
});
|
161
|
-
|
162
|
-
if (window.location.pathname === "/taxonomy/taxonomyform") {
|
163
|
-
fetchIsMultiple();
|
164
|
-
}
|
165
|
-
};
|
166
|
-
handleLocationOrTypeChange();
|
167
|
-
window.addEventListener("popstate", handleLocationOrTypeChange);
|
168
|
-
return () => {
|
169
|
-
window.removeEventListener("popstate", handleLocationOrTypeChange);
|
170
|
-
};
|
150
|
+
fetchIsMultiple();
|
171
151
|
}, [type]);
|
152
|
+
// useEffect(() => {
|
153
|
+
// const fetchIsMultiple = async () => {
|
154
|
+
// try {
|
155
|
+
// const result = await isMultipleApi(type);
|
156
|
+
// setIsMultiple(typeof result === "boolean");
|
157
|
+
// } catch (error) {
|
158
|
+
// console.error("Error checking if taxonomy is multiple:", error);
|
159
|
+
// }
|
160
|
+
// };
|
161
|
+
// const handleLocationOrTypeChange = () => {
|
162
|
+
// if (window.location.pathname === "/taxonomy/taxonomyform") {
|
163
|
+
// fetchIsMultiple();
|
164
|
+
// }
|
165
|
+
// };
|
166
|
+
// handleLocationOrTypeChange();
|
167
|
+
// window.addEventListener("popstate", handleLocationOrTypeChange);
|
168
|
+
// return () => {
|
169
|
+
// window.removeEventListener("popstate", handleLocationOrTypeChange);
|
170
|
+
// };
|
171
|
+
// }, [type]);
|
172
172
|
const handleCancelClick = () => {
|
173
173
|
setType("");
|
174
174
|
setCode("");
|
package/package.json
CHANGED
@@ -44,7 +44,7 @@ const TaxonomyForm = () => {
|
|
44
44
|
|
45
45
|
const [selectedTaxonomyId, setSelectedTaxonomyId] = useState<string>("");
|
46
46
|
|
47
|
-
const [isMultiple, setIsMultiple] = useState(
|
47
|
+
const [isMultiple, setIsMultiple] = useState(false);
|
48
48
|
|
49
49
|
const validateForm = () => {
|
50
50
|
if (!type || !code || !value) {
|
@@ -171,19 +171,6 @@ const TaxonomyForm = () => {
|
|
171
171
|
}
|
172
172
|
};
|
173
173
|
|
174
|
-
// useEffect(() => {
|
175
|
-
// const fetchIsMultiple = async () => {
|
176
|
-
// try {
|
177
|
-
// const result = await isMultipleApi(type);
|
178
|
-
// setIsMultiple(typeof result === "boolean");
|
179
|
-
// } catch (error) {
|
180
|
-
// console.error("Error checking if taxonomy is multiple:", error);
|
181
|
-
// }
|
182
|
-
// };
|
183
|
-
|
184
|
-
// fetchIsMultiple();
|
185
|
-
// }, [type]);
|
186
|
-
|
187
174
|
useEffect(() => {
|
188
175
|
const fetchIsMultiple = async () => {
|
189
176
|
try {
|
@@ -194,20 +181,33 @@ const TaxonomyForm = () => {
|
|
194
181
|
}
|
195
182
|
};
|
196
183
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
184
|
+
fetchIsMultiple();
|
185
|
+
}, [type]);
|
186
|
+
|
187
|
+
// useEffect(() => {
|
188
|
+
// const fetchIsMultiple = async () => {
|
189
|
+
// try {
|
190
|
+
// const result = await isMultipleApi(type);
|
191
|
+
// setIsMultiple(typeof result === "boolean");
|
192
|
+
// } catch (error) {
|
193
|
+
// console.error("Error checking if taxonomy is multiple:", error);
|
194
|
+
// }
|
195
|
+
// };
|
202
196
|
|
203
|
-
|
197
|
+
// const handleLocationOrTypeChange = () => {
|
198
|
+
// if (window.location.pathname === "/taxonomy/taxonomyform") {
|
199
|
+
// fetchIsMultiple();
|
200
|
+
// }
|
201
|
+
// };
|
204
202
|
|
205
|
-
|
203
|
+
// handleLocationOrTypeChange();
|
206
204
|
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
205
|
+
// window.addEventListener("popstate", handleLocationOrTypeChange);
|
206
|
+
|
207
|
+
// return () => {
|
208
|
+
// window.removeEventListener("popstate", handleLocationOrTypeChange);
|
209
|
+
// };
|
210
|
+
// }, [type]);
|
211
211
|
|
212
212
|
const handleCancelClick = () => {
|
213
213
|
setType("");
|