From 9055277656f72b15aa5b261659944ea5fd8e2883 Mon Sep 17 00:00:00 2001 From: Enzo Mercanti Date: Fri, 23 Aug 2024 12:05:08 -0300 Subject: [PATCH] fix: change query used to enable quote link on my account page --- react/B2BQuotesLink.tsx | 2 +- react/graphql/checkPermissions.graphql | 11 +---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/react/B2BQuotesLink.tsx b/react/B2BQuotesLink.tsx index 749e4cd..b488fde 100644 --- a/react/B2BQuotesLink.tsx +++ b/react/B2BQuotesLink.tsx @@ -28,7 +28,7 @@ const B2BQuotesLink: FunctionComponent = ({ render }) => { return } - if (data.getUserByEmail[0]?.id) { + if (data.getQuoteEnabledForUser) { setShow(true) } }, [data, userEmail, sessionResponse]) diff --git a/react/graphql/checkPermissions.graphql b/react/graphql/checkPermissions.graphql index d5060de..eb49d40 100644 --- a/react/graphql/checkPermissions.graphql +++ b/react/graphql/checkPermissions.graphql @@ -1,12 +1,3 @@ query CheckPermissions($email: String!) { - getUserByEmail(email: $email) - @context(provider: "vtex.storefront-permissions") { - id - roleId - userId - clId - orgId - costId - canImpersonate - } + getQuoteEnabledForUser(email: $email) }