Skip to content

Commit

Permalink
Merge pull request #21 from vtex-apps/appSettings
Browse files Browse the repository at this point in the history
App settings
  • Loading branch information
btalma authored Mar 3, 2023
2 parents 0f44678 + 3c6f778 commit 83d73f3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Changed

- Uses `publicSettingsForApp` endpoint to retrieve app settings

### Changed

- GitHub reusable workflow uptaded to v2

## [0.5.0] - 2022-10-20
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"vtex.styleguide": "9.x",
"vtex.apps-graphql": "2.x",
"vtex.apps-graphql": "3.x",
"vtex.cybersource": "1.x",
"vtex.cybersource-payer-auth": "0.x"
},
Expand Down
4 changes: 2 additions & 2 deletions react/Admin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ const Admin: FC = () => {
}

useEffect(() => {
if (!data?.appSettings?.message) return
if (!data?.publicSettingsForApp?.message) return

const parsedSettings: any = JSON.parse(data.appSettings.message)
const parsedSettings: any = JSON.parse(data.publicSettingsForApp.message)

setSettingsState(parsedSettings)
}, [data])
Expand Down
2 changes: 1 addition & 1 deletion react/queries/appSettings.gql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
query AppSettings($version: String) {
appSettings(app: "vtex.cybersource-ui", version: $version)
publicSettingsForApp(app: "vtex.cybersource-ui", version: $version)
@context(provider: "vtex.apps-graphql") {
message
}
Expand Down

0 comments on commit 83d73f3

Please sign in to comment.