eleven-solutions-common-website-unique-web 2.0.29 → 2.0.30
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("");
|
@@ -120,17 +120,18 @@ const TaxonomyForm = () => {
|
|
120
120
|
alert("Failed to add/update Taxonomy");
|
121
121
|
}
|
122
122
|
});
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
123
|
+
useEffect(() => {
|
124
|
+
const fetchIsMultiple = () => __awaiter(void 0, void 0, void 0, function* () {
|
125
|
+
try {
|
126
|
+
const result = yield isMultipleApi(type);
|
127
|
+
setIsMultiple(typeof result === "boolean");
|
128
|
+
}
|
129
|
+
catch (error) {
|
130
|
+
console.error("Error checking if taxonomy is multiple:", error);
|
131
|
+
}
|
132
|
+
});
|
133
|
+
fetchIsMultiple();
|
134
|
+
}, [type]);
|
134
135
|
const handleCancelClick = () => {
|
135
136
|
setType("");
|
136
137
|
setCode("");
|
package/package.json
CHANGED
@@ -148,18 +148,18 @@ const TaxonomyForm = () => {
|
|
148
148
|
}
|
149
149
|
};
|
150
150
|
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
151
|
+
useEffect(() => {
|
152
|
+
const fetchIsMultiple = async () => {
|
153
|
+
try {
|
154
|
+
const result = await isMultipleApi(type);
|
155
|
+
setIsMultiple(typeof result === "boolean");
|
156
|
+
} catch (error) {
|
157
|
+
console.error("Error checking if taxonomy is multiple:", error);
|
158
|
+
}
|
159
|
+
};
|
160
|
+
|
161
|
+
fetchIsMultiple();
|
162
|
+
}, [type]);
|
163
163
|
|
164
164
|
const handleCancelClick = () => {
|
165
165
|
setType("");
|