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

Sign up to get free protection for your applications and to get access to all the features.
@@ -279,10 +279,9 @@ const TaxonomyForm = ({ url }) => {
279
279
  try {
280
280
  yield addTaxonomyApi(url, type, Number(newCode), newValue);
281
281
  alert("Value added successfully");
282
- const fetchedTaxonomies = yield fetchTaxonomiessApi(url);
283
- if (fetchedTaxonomies && Array.isArray(fetchedTaxonomies)) {
284
- setAllTaxonomies(fetchedTaxonomies);
285
- }
282
+ const response = yield fetchTaxonomiessApi(url);
283
+ const filteredTaxonomies = response.filter((taxonomy) => taxonomy.type === type);
284
+ setSimilarTaxonomies(filteredTaxonomies);
286
285
  }
287
286
  catch (error) {
288
287
  console.error("Error adding value:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eleven-solutions-common-website-unique-web",
3
- "version": "19.0.15",
3
+ "version": "19.0.16",
4
4
  "main": "./dist/index.js",
5
5
  "scripts": {
6
6
  "build": "tsc",
@@ -365,10 +365,11 @@ const TaxonomyForm = ({ url }: TaxionomyFormProps) => {
365
365
  await addTaxonomyApi(url, type, Number(newCode), newValue);
366
366
 
367
367
  alert("Value added successfully");
368
- const fetchedTaxonomies = await fetchTaxonomiessApi(url);
369
- if (fetchedTaxonomies && Array.isArray(fetchedTaxonomies)) {
370
- setAllTaxonomies(fetchedTaxonomies);
371
- }
368
+ const response = await fetchTaxonomiessApi(url);
369
+ const filteredTaxonomies = (response as { type: string }[]).filter(
370
+ (taxonomy: { type: string }) => taxonomy.type === type
371
+ );
372
+ setSimilarTaxonomies(filteredTaxonomies);
372
373
  } catch (error) {
373
374
  console.error("Error adding value:", error);
374
375
  }