Skip to content

Commit

Permalink
chore: fix readme code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti committed May 17, 2024
1 parent 9fad64d commit 3d9ce4c
Show file tree
Hide file tree
Showing 3 changed files with 286 additions and 233 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ Many resources have relationships with other resources and instead of including

```javascript
// Fetch 1-to-1 related resource: billing address of an order
const org = clp.memberships.organization('xYZkjABcde')
const org = await clp.memberships.organization('xYZkjABcde')

// Fetch 1-to-N related resources: orders associated to a customer
const perms = clp.roles.permissions('XyzKjAbCDe', { fields: ['can_create', 'can_update'] })
const perms = await clp.roles.permissions('XyzKjAbCDe', { fields: ['can_create', 'can_update'] })
```

In general:
Expand All @@ -280,7 +280,7 @@ resources.

```javascript
// Get the total number of sales_channel credentials
const credentials = clp.api_credentials.count({ filters: { kind_eq: 'sales_channel' } })
const credentials = await clp.api_credentials.count({ filters: { kind_eq: 'sales_channel' } })

```

Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,21 @@
"@babel/preset-env": "^7.24.5",
"@babel/preset-typescript": "^7.24.1",
"@commercelayer/eslint-config-ts": "1.4.5",
"@commercelayer/js-auth": "^6.2.0",
"@commercelayer/js-auth": "^6.2.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.10",
"@types/node": "^20.12.12",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"jest": "^29.7.0",
"json-typescript": "^1.1.2",
"jsonapi-typescript": "^0.1.3",
"lodash.isequal": "^4.5.0",
"semantic-release": "^23.0.8",
"semantic-release": "^23.1.1",
"tsup": "^8.0.2",
"tsx": "^4.9.3",
"tsx": "^4.10.4",
"typescript": "^5.4.5"
},
"repository": "github:commercelayer/provisioning-sdk",
Expand Down
Loading

0 comments on commit 3d9ce4c

Please sign in to comment.