Skip to content

Commit

Permalink
Merge pull request #790 from particle-iot/feature/sc-133607/tachyon-s…
Browse files Browse the repository at this point in the history
…etup-issues

Feature/sc 133607/tachyon setup issues
  • Loading branch information
hugomontero authored Feb 5, 2025
2 parents afeef7d + edaf629 commit f4466fe
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 149 deletions.
19 changes: 15 additions & 4 deletions src/cmd/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,22 @@ module.exports = class ParticleApi {
);
}

createProduct({ name, type, org }) {
createProduct({ name, description = '', platformId, orgSlug, locationOptIn = false } = {}) {
return this._wrap(
this.api.post({
uri: `/v1${org ? `/orgs/${org}` : ''}/products`,
form: { name, type },
uri: `/v1${orgSlug ? `/orgs/${orgSlug}` : '/user'}/products`,
data: {
product: {
name,
description,
platform_id: platformId,
settings: {
location: {
opt_in: locationOptIn
}
},
}
},
auth: this.accessToken
})
);
Expand All @@ -263,7 +274,7 @@ module.exports = class ParticleApi {
getProducts(org) {
return this._wrap(
this.api.get({
uri: `/v1${org ? `/orgs/${org}` : ''}/products`,
uri: `/v1${org ? `/orgs/${org}` : '/user'}/products`,
auth: this.accessToken
})
);
Expand Down
Loading

0 comments on commit f4466fe

Please sign in to comment.