eleven-solutions-common-website-unique-web 19.0.16 → 19.0.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -183,9 +183,22 @@ const TaxonomyForm = ({ url }) => {
183
183
  setNewValue(item.value);
184
184
  setIsModalOpen(true);
185
185
  };
186
+ // const handleEditClick = (index: number, id: string) => {
187
+ // setIsAddingSubType(false);
188
+ // const item = similarTaxonomies[index];
189
+ // setSelectedTaxonomyId(id);
190
+ // setEditTaxonomyItem(item);
191
+ // setNewCode(item.code);
192
+ // setNewValue(item.value);
193
+ // setIsModalOpen(true);
194
+ // };
186
195
  const handleEditClick = (index, id) => {
187
196
  setIsAddingSubType(false);
188
- const item = similarTaxonomies[index];
197
+ const item = similarTaxonomies.find((taxonomy) => taxonomy.id === id);
198
+ if (!item) {
199
+ console.error("Taxonomy not found");
200
+ return;
201
+ }
189
202
  setSelectedTaxonomyId(id);
190
203
  setEditTaxonomyItem(item);
191
204
  setNewCode(item.code);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "19.0.16",
3
+ "version": "19.0.17",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -233,12 +233,28 @@ const TaxonomyForm = ({ url }: TaxionomyFormProps) => {
233
233
  setIsModalOpen(true);
234
234
  };
235
235
 
236
+ // const handleEditClick = (index: number, id: string) => {
237
+ // setIsAddingSubType(false);
238
+
239
+ // const item = similarTaxonomies[index];
240
+ // setSelectedTaxonomyId(id);
241
+
242
+ // setEditTaxonomyItem(item);
243
+ // setNewCode(item.code);
244
+ // setNewValue(item.value);
245
+ // setIsModalOpen(true);
246
+ // };
236
247
  const handleEditClick = (index: number, id: string) => {
237
248
  setIsAddingSubType(false);
238
249
 
239
- const item = similarTaxonomies[index];
240
- setSelectedTaxonomyId(id);
250
+ const item = similarTaxonomies.find((taxonomy) => taxonomy.id === id);
241
251
 
252
+ if (!item) {
253
+ console.error("Taxonomy not found");
254
+ return;
255
+ }
256
+
257
+ setSelectedTaxonomyId(id);
242
258
  setEditTaxonomyItem(item);
243
259
  setNewCode(item.code);
244
260
  setNewValue(item.value);