From 270d16a5136492699af8b6d12ec4927a0d814685 Mon Sep 17 00:00:00 2001 From: csuadev <72958726+csuadev@users.noreply.github.com> Date: Thu, 26 Oct 2023 20:03:28 -0500 Subject: [PATCH] chore: hide marketplace categories when hidden property comes as true (#30752) --- .../client/views/marketplace/hooks/useCategories.ts | 12 +++++++----- apps/meteor/ee/client/apps/@types/IOrchestrator.ts | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/meteor/client/views/marketplace/hooks/useCategories.ts b/apps/meteor/client/views/marketplace/hooks/useCategories.ts index 4a457a146046..bf7a022f2ae3 100644 --- a/apps/meteor/client/views/marketplace/hooks/useCategories.ts +++ b/apps/meteor/client/views/marketplace/hooks/useCategories.ts @@ -21,11 +21,13 @@ export const useCategories = (): [CategoryDropDownGroups, selectedCategoriesList try { const fetchedCategories = await AppClientOrchestratorInstance.getCategories(); - const mappedCategories = fetchedCategories.map((currentCategory) => ({ - id: currentCategory.id, - label: currentCategory.title, - checked: false, - })); + const mappedCategories = fetchedCategories + .filter((currentCategory) => !currentCategory.hidden) + .map((currentCategory) => ({ + id: currentCategory.id, + label: currentCategory.title, + checked: false, + })); setCategories([ { diff --git a/apps/meteor/ee/client/apps/@types/IOrchestrator.ts b/apps/meteor/ee/client/apps/@types/IOrchestrator.ts index 246fd18326c4..ac2642161c2e 100644 --- a/apps/meteor/ee/client/apps/@types/IOrchestrator.ts +++ b/apps/meteor/ee/client/apps/@types/IOrchestrator.ts @@ -23,6 +23,7 @@ export interface IAppExternalURL { export interface ICategory { createdDate: Date; description: string; + hidden: boolean; id: string; modifiedDate: Date; title: string;