Skip to content

Commit f4466fe

Browse files
authored
Merge pull request #790 from particle-iot/feature/sc-133607/tachyon-setup-issues
Feature/sc 133607/tachyon setup issues
2 parents afeef7d + edaf629 commit f4466fe

File tree

3 files changed

+165
-149
lines changed

3 files changed

+165
-149
lines changed

src/cmd/api.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,11 +250,22 @@ module.exports = class ParticleApi {
250250
);
251251
}
252252

253-
createProduct({ name, type, org }) {
253+
createProduct({ name, description = '', platformId, orgSlug, locationOptIn = false } = {}) {
254254
return this._wrap(
255255
this.api.post({
256-
uri: `/v1${org ? `/orgs/${org}` : ''}/products`,
257-
form: { name, type },
256+
uri: `/v1${orgSlug ? `/orgs/${orgSlug}` : '/user'}/products`,
257+
data: {
258+
product: {
259+
name,
260+
description,
261+
platform_id: platformId,
262+
settings: {
263+
location: {
264+
opt_in: locationOptIn
265+
}
266+
},
267+
}
268+
},
258269
auth: this.accessToken
259270
})
260271
);
@@ -263,7 +274,7 @@ module.exports = class ParticleApi {
263274
getProducts(org) {
264275
return this._wrap(
265276
this.api.get({
266-
uri: `/v1${org ? `/orgs/${org}` : ''}/products`,
277+
uri: `/v1${org ? `/orgs/${org}` : '/user'}/products`,
267278
auth: this.accessToken
268279
})
269280
);

0 commit comments

Comments
 (0)