Skip to content

Commit 60e9c48

Browse files
committed
Update docs + CHANGELOG
1 parent 1ba9a02 commit 60e9c48

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# TeamSnap JavaScript SDK CHANGELOG
22

3+
### Feb 15, 2016 // Version 1.9.0
4+
- Refactors `bulkLoad` to accept "Smart Load" params.
5+
6+
---
7+
38
### Feb 4, 2016 // Version 1.8.1
49
- Update `canEditItem()` helper to return false when a manager attempts to edit an owner's member item.
510

docs/collections/teams.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,44 @@ teamsnap.saveTeam(team).then(function(){
146146

147147

148148
<a id="bulkLoad"></a>
149-
## `bulkLoad(teamId, types, callback)`
149+
## `bulkLoad(teamId, types, callback)` / `bulkLoad(params, callback)`
150150
Query that returns multiple types based on provided parameters.
151151

152+
In addition to bulk loading specific types for a given team, you can scope and filter the query to
153+
return more specific datasets. We sometimes refer to this as "Smart Load", but it's still APIv3's
154+
`bulk_load` query.
155+
152156
_Note: Some items, such as `availability` are not currently available for `bulkLoad` for performance reasons. Likewise, loading many types at once without narrowing the scope may provide a less than optimal response, or possibly incur an API timeout with larger datasets._
153157

154158
### Params
159+
_Note: There are two ways you can call `bulkLoad`. This is the simple / classic way._
155160
* `teamId`: [int] - a `teamId` to load items for.
156161
* `types`: [array] - array of types to load.
157162
* `callback`: [function] - callback to be executed when the operation completes.
158163

164+
_Using "Smart Load" params_
165+
* `params`: [object] - object should contain the following params:
166+
- `teamId`: [int] - a `teamId` to load items for.
167+
- `types`: [array] - array of types to load.
168+
- `scopeTo`: [string] - item in the query to scope other items to.
169+
- `[itemType__queryParam]`: [string] - additional filters can be set with the item's type and one of its available search params separated by a double underscore (`__`). This accepts a string for the value - which could be a date, an ID, or event a list of IDs. See the specific event's available search params with `teamsnap.collections.[itemCollection].queries.search.params` where `itemCollection` is the collection to look up.
170+
* `callback`: [function] - callback to be executed when the operation completes.
171+
159172
### Examples
160173
```javascript
161174
// ~~~~~
162175
// Bulk loads several types at once.
163-
teamsnap.bulkLoad(1, ['member', 'event', 'availability']);
176+
teamsnap.bulkLoad(1, ['member', 'event', 'assignment']);
177+
178+
// ~~~~~
179+
// Bulk load events and assignments related to eventId 1-6.
180+
bulkLoadParams = {
181+
teamId: 1,
182+
types: ['event', 'assignment'],
183+
scopeTo: 'event',
184+
event__id: '1,2,3,4,5,6'
185+
}
186+
teamsnap.bulkLoad(bulkLoadParams);
164187
```
165188

166189

0 commit comments

Comments
 (0)