eleven-solutions-common-website-unique-web 21.0.40 → 21.0.41
Sign up to get free protection for your applications and to get access to all the features.
@@ -151,6 +151,7 @@ const TaxonomyForm = ({ url }) => {
|
|
151
151
|
setIsAddingSubType(true);
|
152
152
|
};
|
153
153
|
const handleSubTypeSubmitClick = () => __awaiter(void 0, void 0, void 0, function* () {
|
154
|
+
var _a, _b;
|
154
155
|
if (!subCode || !subValue) {
|
155
156
|
alert("Please fill out both Code and Value fields before proceeding.");
|
156
157
|
return;
|
@@ -171,7 +172,8 @@ const TaxonomyForm = ({ url }) => {
|
|
171
172
|
}
|
172
173
|
catch (error) {
|
173
174
|
console.error(`Error ${editTaxonomyItem ? "editing" : "adding"} SubType:`, error);
|
174
|
-
|
175
|
+
const errorMessage = ((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) || ((_b = error.response) === null || _b === void 0 ? void 0 : _b.statusText) || error.message;
|
176
|
+
alert(`Error while ${editTaxonomyItem ? "editing" : "adding"} SubType: ${errorMessage}`);
|
175
177
|
}
|
176
178
|
setIsModalOpen(false);
|
177
179
|
setSubCode("");
|
package/package.json
CHANGED
@@ -234,7 +234,14 @@ const TaxonomyForm = ({ url }: TaxionomyFormProps) => {
|
|
234
234
|
`Error ${editTaxonomyItem ? "editing" : "adding"} SubType:`,
|
235
235
|
error
|
236
236
|
);
|
237
|
-
|
237
|
+
const errorMessage =
|
238
|
+
error.response?.data || error.response?.statusText || error.message;
|
239
|
+
|
240
|
+
alert(
|
241
|
+
`Error while ${
|
242
|
+
editTaxonomyItem ? "editing" : "adding"
|
243
|
+
} SubType: ${errorMessage}`
|
244
|
+
);
|
238
245
|
}
|
239
246
|
|
240
247
|
setIsModalOpen(false);
|