eleven-solutions-common-website-unique-web 4.0.0 → 4.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -28,7 +28,7 @@ const TaxonomyForm = () => {
|
|
28
28
|
const [selectedTaxonomyId, setSelectedTaxonomyId] = useState("");
|
29
29
|
const [isMultiple, setIsMultiple] = useState(false);
|
30
30
|
const validateForm = () => {
|
31
|
-
if (!
|
31
|
+
if (!inputType || !code || !value) {
|
32
32
|
alert("Please fill in all required fields: Type, Code, and Value.");
|
33
33
|
return false;
|
34
34
|
}
|
@@ -106,7 +106,7 @@ const TaxonomyForm = () => {
|
|
106
106
|
alert("Taxonomies added successfully");
|
107
107
|
}
|
108
108
|
else {
|
109
|
-
yield addTaxonomyApi(
|
109
|
+
yield addTaxonomyApi(inputType, Number(code), value);
|
110
110
|
alert("Taxonomy added successfully");
|
111
111
|
}
|
112
112
|
window.history.pushState({}, "", "/admin/users");
|
@@ -124,11 +124,11 @@ const TaxonomyForm = () => {
|
|
124
124
|
return;
|
125
125
|
try {
|
126
126
|
if (isEditMode) {
|
127
|
-
yield updateTaxonomyApi(id,
|
127
|
+
yield updateTaxonomyApi(id, inputType, Number(code), value);
|
128
128
|
alert("Taxonomy updated successfully");
|
129
129
|
}
|
130
130
|
else {
|
131
|
-
yield addTaxonomyApi(
|
131
|
+
yield addTaxonomyApi(inputType, Number(code), value);
|
132
132
|
alert("Taxonomy added successfully");
|
133
133
|
}
|
134
134
|
window.location.href = "/admin/taxinomies";
|
package/package.json
CHANGED
@@ -48,7 +48,7 @@ const TaxonomyForm = () => {
|
|
48
48
|
const [isMultiple, setIsMultiple] = useState(false);
|
49
49
|
|
50
50
|
const validateForm = () => {
|
51
|
-
if (!
|
51
|
+
if (!inputType || !code || !value) {
|
52
52
|
alert("Please fill in all required fields: Type, Code, and Value.");
|
53
53
|
return false;
|
54
54
|
}
|
@@ -141,7 +141,7 @@ const TaxonomyForm = () => {
|
|
141
141
|
setTempTaxonomy([]);
|
142
142
|
alert("Taxonomies added successfully");
|
143
143
|
} else {
|
144
|
-
await addTaxonomyApi(
|
144
|
+
await addTaxonomyApi(inputType, Number(code), value);
|
145
145
|
alert("Taxonomy added successfully");
|
146
146
|
}
|
147
147
|
window.history.pushState({}, "", "/admin/users");
|
@@ -159,10 +159,10 @@ const TaxonomyForm = () => {
|
|
159
159
|
|
160
160
|
try {
|
161
161
|
if (isEditMode) {
|
162
|
-
await updateTaxonomyApi(id,
|
162
|
+
await updateTaxonomyApi(id, inputType, Number(code), value);
|
163
163
|
alert("Taxonomy updated successfully");
|
164
164
|
} else {
|
165
|
-
await addTaxonomyApi(
|
165
|
+
await addTaxonomyApi(inputType, Number(code), value);
|
166
166
|
alert("Taxonomy added successfully");
|
167
167
|
}
|
168
168
|
window.location.href = "/admin/taxinomies";
|