Skip to content

Commit 035c8d5

Browse files
committed
use 'owner' in dataset endpoints
1 parent 5224bc7 commit 035c8d5

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/constants.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module.exports.API_GEOCODER_REVERSE = compile('${endpoint}/v4/geocode/${dataset}
66
module.exports.API_DIRECTIONS = compile('${endpoint}/v4/directions/${profile}/${encodedWaypoints}.json?${query}');
77
module.exports.API_SURFACE = compile('${endpoint}/v4/surface/${mapid}.json?${query}');
88
module.exports.API_MATCHING = compile('${endpoint}/matching/v4/${profile}.json?${query}');
9-
module.exports.API_DATASET_DATASETS = compile('${endpoint}/datasets/v1/${user}?${query}');
10-
module.exports.API_DATASET_DATASET = compile('${endpoint}/datasets/v1/${user}/${dataset}?${query}');
11-
module.exports.API_DATASET_FEATURES = compile('${endpoint}/datasets/v1/${user}/${dataset}/features?${query}');
12-
module.exports.API_DATASET_FEATURE = compile('${endpoint}/datasets/v1/${user}/${dataset}/features/${id}?${query}');
9+
module.exports.API_DATASET_DATASETS = compile('${endpoint}/datasets/v1/${owner}?${query}');
10+
module.exports.API_DATASET_DATASET = compile('${endpoint}/datasets/v1/${owner}/${dataset}?${query}');
11+
module.exports.API_DATASET_FEATURES = compile('${endpoint}/datasets/v1/${owner}/${dataset}/features?${query}');
12+
module.exports.API_DATASET_FEATURE = compile('${endpoint}/datasets/v1/${owner}/${dataset}/features/${id}?${query}');

lib/services/datasets.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ var Datasets = module.exports = makeService('MapboxDatasets');
4343
Datasets.prototype.listDatasets = function(callback) {
4444
invariant(typeof callback === 'function', 'callback must be a function');
4545

46-
var url = makeURL(this, constants.API_DATASET_DATASETS, { user: this.user });
46+
var url = makeURL(this, constants.API_DATASET_DATASETS, { owner: this.user });
4747

4848
request(url, function(err, res) {
4949
callback(err, res.body);
@@ -86,7 +86,7 @@ Datasets.prototype.createDataset = function(options, callback) {
8686
if (options.name) invariant(typeof options.name === 'string', 'options.name must be a string');
8787
if (options.description) invariant(typeof options.description === 'string', 'options.description must be a string');
8888

89-
var url = makeURL(this, constants.API_DATASET_DATASETS, { user: this.user });
89+
var url = makeURL(this, constants.API_DATASET_DATASETS, { owner: this.user });
9090

9191
request
9292
.post(url)
@@ -122,7 +122,7 @@ Datasets.prototype.readDataset = function(dataset, callback) {
122122
invariant(typeof callback === 'function', 'callback must be a function');
123123

124124
var url = makeURL(this, constants.API_DATASET_DATASET, {
125-
user: this.user,
125+
owner: this.user,
126126
dataset: dataset
127127
});
128128

@@ -166,7 +166,7 @@ Datasets.prototype.updateDataset = function(dataset, options, callback) {
166166
if (options.description) invariant(typeof options.description === 'string', 'options.description must be a string');
167167

168168
var url = makeURL(this, constants.API_DATASET_DATASET, {
169-
user: this.user,
169+
owner: this.user,
170170
dataset: dataset
171171
});
172172

@@ -196,7 +196,7 @@ Datasets.prototype.deleteDataset = function(dataset, callback) {
196196
invariant(typeof callback === 'function', 'callback must be a function');
197197

198198
var url = makeURL(this, constants.API_DATASET_DATASET, {
199-
user: this.user,
199+
owner: this.user,
200200
dataset: dataset
201201
});
202202

@@ -242,7 +242,7 @@ Datasets.prototype.listFeatures = function(dataset, callback) {
242242
invariant(typeof callback === 'function', 'callback must be a function');
243243

244244
var url = makeURL(this, constants.API_DATASET_FEATURES, {
245-
user: this.user,
245+
owner: this.user,
246246
dataset: dataset
247247
});
248248

@@ -332,7 +332,7 @@ Datasets.prototype.insertFeature = function(feature, dataset, callback) {
332332
invariant(typeof id === 'string', 'The GeoJSON feature\'s id must be a string');
333333

334334
var url = makeURL(this, constants.API_DATASET_FEATURE, {
335-
user: this.user,
335+
owner: this.user,
336336
dataset: dataset,
337337
id: id
338338
});
@@ -376,7 +376,7 @@ Datasets.prototype.readFeature = function(id, dataset, callback) {
376376
invariant(typeof callback === 'function', 'callback must be a function');
377377

378378
var url = makeURL(this, constants.API_DATASET_FEATURE, {
379-
user: this.user,
379+
owner: this.user,
380380
dataset: dataset,
381381
id: id
382382
});
@@ -406,7 +406,7 @@ Datasets.prototype.deleteFeature = function(id, dataset, callback) {
406406
invariant(typeof callback === 'function', 'callback must be a function');
407407

408408
var url = makeURL(this, constants.API_DATASET_FEATURE, {
409-
user: this.user,
409+
owner: this.user,
410410
dataset: dataset,
411411
id: id
412412
});
@@ -515,7 +515,7 @@ Datasets.prototype.bulkFeatureUpdate = function(put, deletes, dataset, callback)
515515
);
516516

517517
var url = makeURL(this, constants.API_DATASET_FEATURES, {
518-
user: this.user,
518+
owner: this.user,
519519
dataset: dataset
520520
});
521521

0 commit comments

Comments
 (0)