eleven-solutions-common-website-unique-web 4.0.15 → 4.0.16

Sign up to get free protection for your applications and to get access to all the features.
@@ -80,29 +80,15 @@ const TaxonomyForm = () => {
80
80
  setIsSimilarTaxonomyOpen(true);
81
81
  }
82
82
  }, []);
83
- // useEffect(() => {
84
- // const handleLocationChange = () => {
85
- // if (window.location.pathname === "/taxonomy/taxonomyform") {
86
- // setIsSimilarTaxonomyOpen(true);
87
- // }
88
- // else {
89
- // setIsSimilarTaxonomyOpen(false);
90
- // }
91
- // };
92
- // handleLocationChange();
93
- // window.addEventListener("popstate", handleLocationChange);
94
- // return () => {
95
- // window.removeEventListener("popstate", handleLocationChange);
96
- // };
97
- // }, []);
98
83
  const handleSubmit = (event) => __awaiter(void 0, void 0, void 0, function* () {
99
84
  event.preventDefault();
100
- // if (!validateForm()) return;
85
+ if (!validateForm())
86
+ return;
101
87
  try {
102
88
  if (isEditMode) {
103
89
  yield addMultipleTaxonomiesApi(tempTaxonomy);
104
90
  setTempTaxonomy([]);
105
- alert("Taxonomies added successfully");
91
+ alert("Taxonomies saved successfully");
106
92
  }
107
93
  else {
108
94
  yield addTaxonomyApi(inputType, Number(code), value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "4.0.15",
3
+ "version": "4.0.16",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -112,34 +112,15 @@ const TaxonomyForm = () => {
112
112
  }
113
113
  }, []);
114
114
 
115
- // useEffect(() => {
116
- // const handleLocationChange = () => {
117
- // if (window.location.pathname === "/taxonomy/taxonomyform") {
118
- // setIsSimilarTaxonomyOpen(true);
119
- // }
120
- // else {
121
- // setIsSimilarTaxonomyOpen(false);
122
- // }
123
- // };
124
-
125
- // handleLocationChange();
126
-
127
- // window.addEventListener("popstate", handleLocationChange);
128
-
129
- // return () => {
130
- // window.removeEventListener("popstate", handleLocationChange);
131
- // };
132
- // }, []);
133
-
134
115
  const handleSubmit = async (event: React.MouseEvent<HTMLButtonElement>) => {
135
116
  event.preventDefault();
136
- // if (!validateForm()) return;
117
+ if (!validateForm()) return;
137
118
 
138
119
  try {
139
120
  if (isEditMode) {
140
121
  await addMultipleTaxonomiesApi(tempTaxonomy);
141
122
  setTempTaxonomy([]);
142
- alert("Taxonomies added successfully");
123
+ alert("Taxonomies saved successfully");
143
124
  } else {
144
125
  await addTaxonomyApi(inputType, Number(code), value);
145
126
  alert("Taxonomy added successfully");