eleven-solutions-common-website-unique-web 2.0.22 → 2.0.23
Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
};
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
11
11
|
import { useState, useEffect } from "react";
|
12
|
-
import { addTaxonomyApi, fetchTaxonomyByIdApi, updateTaxonomyApi, fetchTaxonomiessApi, addMultipleTaxonomiesApi, deleteTaxonomyApi, } from "../api/taxonomy";
|
12
|
+
import { addTaxonomyApi, fetchTaxonomyByIdApi, updateTaxonomyApi, fetchTaxonomiessApi, addMultipleTaxonomiesApi, deleteTaxonomyApi, isMultipleApi, } from "../api/taxonomy";
|
13
13
|
import { FaPlus } from "react-icons/fa";
|
14
14
|
const TaxonomyForm = () => {
|
15
15
|
const [type, setType] = useState("");
|
@@ -121,17 +121,18 @@ const TaxonomyForm = () => {
|
|
121
121
|
alert("Failed to add/update Taxonomy");
|
122
122
|
}
|
123
123
|
});
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
124
|
+
useEffect(() => {
|
125
|
+
const fetchIsMultiple = () => __awaiter(void 0, void 0, void 0, function* () {
|
126
|
+
try {
|
127
|
+
const result = yield isMultipleApi(type);
|
128
|
+
setIsMultiple(typeof result === "boolean");
|
129
|
+
}
|
130
|
+
catch (error) {
|
131
|
+
console.error("Error checking if taxonomy is multiple:", error);
|
132
|
+
}
|
133
|
+
});
|
134
|
+
fetchIsMultiple();
|
135
|
+
}, [type]);
|
135
136
|
const handleCancelClick = () => {
|
136
137
|
setType("");
|
137
138
|
setCode("");
|
package/package.json
CHANGED
@@ -149,18 +149,18 @@ const TaxonomyForm = () => {
|
|
149
149
|
}
|
150
150
|
};
|
151
151
|
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
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
|
+
|
162
|
+
fetchIsMultiple();
|
163
|
+
}, [type]);
|
164
164
|
|
165
165
|
const handleCancelClick = () => {
|
166
166
|
setType("");
|