From 5d581d640fcded1d2cca064a9d248f3678b8be56 Mon Sep 17 00:00:00 2001 From: AldemirLucas Date: Tue, 19 Sep 2023 14:41:36 -0300 Subject: [PATCH] fix under_review table, raw data source, i.request --- next/components/organisms/DatasetResource.js | 12 ++++++------ next/pages/api/team/getAllPeople.js | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/next/components/organisms/DatasetResource.js b/next/components/organisms/DatasetResource.js index 099ee5f9..c142152c 100644 --- a/next/components/organisms/DatasetResource.js +++ b/next/components/organisms/DatasetResource.js @@ -111,13 +111,13 @@ export default function DatasetResource({ } useEffect(() => { - const dataset_tables = dataset?.tables?.edges.map((elm) => elm.node) || [] - const raw_data_sources = dataset?.rawDataSources?.edges.map((elm) => elm.node) || [] - const information_request = dataset?.informationRequests?.edges.map((elm) => elm.node) || [] + const dataset_tables = dataset?.tables?.edges.map((elm) => elm.node).filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements) || [] + const raw_data_sources = dataset?.rawDataSources?.edges.map((elm) => elm.node).filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements) || [] + const information_request = dataset?.informationRequests?.edges.map((elm) => elm.node).filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements) || [] - setTables(dataset_tables.filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements)) - setRawDataSources(raw_data_sources.filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements)) - setInformationRequests(information_request.filter((elm) => elm?.status?.slug !== "under_review").sort(sortElements)) + setTables(dataset_tables) + setRawDataSources(raw_data_sources) + setInformationRequests(information_request) const queryParams = new URLSearchParams(window.location.search) diff --git a/next/pages/api/team/getAllPeople.js b/next/pages/api/team/getAllPeople.js index 037792ea..e9e175f9 100644 --- a/next/pages/api/team/getAllPeople.js +++ b/next/pages/api/team/getAllPeople.js @@ -10,7 +10,7 @@ export default async function getAllPeople() { data: { query: ` query { - allAccount { + allAccount (profile: A_1){ edges { node { firstName @@ -36,13 +36,13 @@ export default async function getAllPeople() { } } } + edgeCount } } ` } }) - const result = res?.data?.data?.allAccount?.edges - const data = result.filter(item => item.node.isActiveStaff === 'true') + const data = res?.data?.data?.allAccount?.edges return data } catch (error) { console.error(error)