From 9055277656f72b15aa5b261659944ea5fd8e2883 Mon Sep 17 00:00:00 2001 From: Enzo Mercanti Date: Fri, 23 Aug 2024 12:05:08 -0300 Subject: [PATCH 1/2] 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) } From c86c3a6472b5544be3a14664e178de375ce078f6 Mon Sep 17 00:00:00 2001 From: Enzo Mercanti Date: Mon, 2 Sep 2024 14:00:13 -0300 Subject: [PATCH 2/2] fix: changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82a244e..554ad57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Use getQuotesEnabledForUser instead of getUserByEmail to define "My Quotes" button visibility + ## [1.6.2] - 2024-08-15 ### Removed