diff --git a/CHANGELOG.md b/CHANGELOG.md index df4a1ad..aab354b 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.3] - 2024-09-04 ### Fixed 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) }