Skip to content

Commit 9d2992e

Browse files
committed
Build v1.9.0
1 parent 878f6d3 commit 9d2992e

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

lib/teamsnap.js

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,13 +2768,22 @@ exports.deleteTeam = function(team, callback) {
27682768
};
27692769

27702770
exports.bulkLoad = function(teamId, types, callback) {
2771-
var params;
2772-
if (!this.isId(teamId)) {
2773-
throw new TSArgsError('teamsnap.bulkLoad', 'teamId must be provided');
2774-
}
2775-
if (typeof types === 'function') {
2776-
callback = types;
2777-
types = null;
2771+
var loadParams, params;
2772+
if (typeof teamId === 'object') {
2773+
loadParams = teamId;
2774+
if (!this.isId(loadParams.teamId)) {
2775+
throw new TSArgsError('teamsnap.bulkLoad', 'teamId must be provided');
2776+
}
2777+
teamId = loadParams.teamId;
2778+
types = loadParams.types;
2779+
} else {
2780+
if (!this.isId(teamId)) {
2781+
throw new TSArgsError('teamsnap.bulkLoad', 'teamId must be provided');
2782+
}
2783+
if (typeof types === 'function') {
2784+
callback = types;
2785+
types = null;
2786+
}
27782787
}
27792788
if (!Array.isArray(types)) {
27802789
types = this.getTeamTypes();
@@ -2784,6 +2793,9 @@ exports.bulkLoad = function(teamId, types, callback) {
27842793
teamId: teamId,
27852794
types: types.map(this.underscoreType).join(',')
27862795
};
2796+
if ((loadParams != null ? loadParams.scopeTo : void 0) != null) {
2797+
params.scopeTo = this.underscoreType(loadParams.scopeTo);
2798+
}
27872799
return this.collections.root.queryItems('bulkLoad', params, callback);
27882800
};
27892801

@@ -3854,7 +3866,7 @@ MetaList = (function() {
38543866
};
38553867

38563868
MetaList.prototype._request = function(request, method, rel, params, type) {
3857-
var data, entry, key, value;
3869+
var data, entry, filteredOn, itemCollection, key, value;
38583870
if (!(entry = this[rel])) {
38593871
throw new TSError("Unable to find rel '" + rel + "'");
38603872
}
@@ -3874,6 +3886,12 @@ MetaList = (function() {
38743886
}
38753887
if (entry.params.hasOwnProperty(key)) {
38763888
data[underscore(key)] = value;
3889+
} else if (key.indexOf('__') !== -1) {
3890+
filteredOn = key.split('__');
3891+
itemCollection = teamsnap.getCollectionForItem(filteredOn[0]);
3892+
if (itemCollection.queries.search.params.hasOwnProperty(filteredOn[1])) {
3893+
data[underscore(key)] = value;
3894+
}
38773895
}
38783896
}
38793897
}
@@ -5769,7 +5787,7 @@ ref = require('./model'), Collection = ref.Collection, Item = ref.Item;
57695787
require('./errors');
57705788

57715789
TeamSnap = (function() {
5772-
TeamSnap.prototype.version = '1.8.1';
5790+
TeamSnap.prototype.version = '1.9.0';
57735791

57745792
TeamSnap.prototype.promises = promises;
57755793

0 commit comments

Comments
 (0)