Skip to content

Commit

Permalink
fix: change query used to enable quote link on my account page (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
enzomerca authored Sep 5, 2024
1 parent 3d12d13 commit 8993790
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion react/B2BQuotesLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const B2BQuotesLink: FunctionComponent<Props> = ({ render }) => {
return
}

if (data.getUserByEmail[0]?.id) {
if (data.getQuoteEnabledForUser) {
setShow(true)
}
}, [data, userEmail, sessionResponse])
Expand Down
11 changes: 1 addition & 10 deletions react/graphql/checkPermissions.graphql
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit 8993790

Please sign in to comment.