Skip to content

Commit 77c47d8

Browse files
author
Dustin McCraw
committed
Update names to better match existing methods
1 parent 70942b2 commit 77c47d8

File tree

15 files changed

+67
-170
lines changed

15 files changed

+67
-170
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
- Add `divisions` endpoint.
55
- Update validations on `broadcastEmail`.`saveBroadcastEmail`.
66
- Add `bulkDeleteBroadcastEmails` method.
7-
- Add `searchDivisionMembers` method.
8-
- Add `searchDivisionTeams` method.
7+
- Add `divisionLoadMembers` method.
8+
- Add `divisionLoadTeams` method.
99

1010
---
1111

docs/collections.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ An APIv3 endpoint’s name is generally derived from its `Collection+JSON` colle
1919
- [Division Members](./collections/division_members.md)
2020
- [Division Members Preferences](./collections/division_members_preferences.md)
2121
- [Division Team Standings](./collections/division_team_standings.md)
22+
- [Divisions](./collections/divisions.md)
2223
- [Events](./collections/events.md)
2324
- [Event Statistics](./collections/event_statistics.md)
2425
- [Facebook Pages](./collections/facebook_pages.md)

docs/collections/broadcast_emails.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ teamsnap.saveBroadcastEmail(broadcastEmail).then(function(){
123123

124124
<a id="bulkDeleteBroadcastEmails"></a>
125125
## `bulkDeleteBroadcastEmails(broadcastEmailIds, callback)`
126-
Bulk deletes a list of `broadcastEmail` item.
126+
Bulk deletes a list of `broadcastEmail` items.
127127

128128
### Params
129129
* `broadcastEmailIds`: [array] - An array of broadcastEmailIds to be deleted.
@@ -132,7 +132,7 @@ Bulk deletes a list of `broadcastEmail` item.
132132
### Examples
133133
```javascript
134134
// ~~~~~
135-
// Deletes a broadcastEmail item.
135+
// Deletes multiple broadcastEmail items.
136136
teamsnap.bulkDeleteBroadcastEmails([1,2,3])
137137
```
138138

docs/collections/divisions.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
- [loadDivision](#loadDivision)
77
- [createDivision](#createDivision)
88
- [deleteDivision](#deleteDivision)
9-
- [ancestorDivisions](#ancestorDivisions)
10-
- [descendantDivisions](#descendantDivisions)
11-
- [childrenDivisions](#childrenDivisions)
9+
- [loadAncestorDivisions](#loadAncestorDivisions)
10+
- [loadDescendantDivisions](#loadDescendantDivisions)
11+
- [loadChildDivisions](#loadChildDivisions)
1212

1313
---
1414
<a id="loadDivisions"></a>
@@ -143,54 +143,54 @@ teamsnap.saveDivision(division).then(function(){
143143
---
144144

145145

146-
<a id="ancestorDivisions"></a>
147-
## `ancestorDivisions(divisionId, callback)`
146+
<a id="loadAncestorDivisions"></a>
147+
## `loadAncestorDivisions(divisionId, callback)`
148148
Returns the ancestor `division` items.
149149

150150
### Params
151-
* `divisionId`: [int] - an divisionId.
151+
* `divisionId`: [int] - a divisionId.
152152
* `callback`: [function] - callback to be executed when the operation completes.
153153
### Examples
154154
```javascript
155155
// ~~~~~
156156
// Returns the ancestor divisions.
157-
var divisions = teamsnap.ancestorDivisions(1);
157+
var divisions = teamsnap.loadAncestorDivisions(1);
158158
```
159159

160160

161161
---
162162

163163

164-
<a id="descendantDivisions"></a>
165-
## `descendantDivisions(divisionId, callback)`
164+
<a id="loadDescendantDivisions"></a>
165+
## `loadDescendantDivisions(divisionId, callback)`
166166
Returns the descendant `division` items.
167167

168168
### Params
169-
* `divisionId`: [int] - an divisionId.
169+
* `divisionId`: [int] - a divisionId.
170170
* `callback`: [function] - callback to be executed when the operation completes.
171171
### Examples
172172
```javascript
173173
// ~~~~~
174-
// Returns the ancestor divisions.
175-
var divisions = teamsnap.descendantDivisions(1);
174+
// Returns the descendant divisions.
175+
var divisions = teamsnap.loadDescendantDivisions(1);
176176
```
177177

178178

179179
---
180180

181181

182-
<a id="childrenDivisions"></a>
183-
## `childrenDivisions(divisionId, callback)`
182+
<a id="loadChildDivisions"></a>
183+
## `loadChildDivisions(divisionId, callback)`
184184
Returns the child `division` items.
185185

186186
### Params
187-
* `divisionId`: [int] - an divisionId.
187+
* `divisionId`: [int] - a divisionId.
188188
* `callback`: [function] - callback to be executed when the operation completes.
189189
### Examples
190190
```javascript
191191
// ~~~~~
192-
// Returns the ancestor divisions.
193-
var divisions = teamsnap.childrenDivisions(1);
192+
// Returns the child divisions.
193+
var divisions = teamsnap.loadChildDivisions(1);
194194
```
195195

196196

docs/collections/members.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
- [canEditItem](#canEditItem)
1717
- [importMembersFromTeam](#importMembersFromTeam)
1818
- [loadImportableMembers](#loadImportableMembers)
19-
- [divisionSearchMembers](#divisionSearchMembers)
19+
- [divisionLoadMembers](#divisionLoadMembers)
2020

2121

2222
---
@@ -337,8 +337,8 @@ teamsnap.loadImportableMembers(8, true);
337337
---
338338

339339

340-
<a id="divisionSearchMembers"></a>
341-
## `divisionSearchMembers(params)`
340+
<a id="divisionLoadMembers"></a>
341+
## `divisionLoadMembers(params)`
342342
Search for members in a division.
343343

344344
### Params
@@ -348,7 +348,7 @@ Search for members in a division.
348348
```javascript
349349
// ~~~~~
350350
// Return all the active members in a division
351-
teamsnap.divisionSearchMembers({divisionId: 1, isActive: true});
351+
teamsnap.divisionLoadMembers({divisionId: 1, isActive: true});
352352
```
353353

354354

docs/collections/teams.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- [invite](#invite)
1212
- [updateTimeZone](#updateTimeZone)
1313
- [resetStatistics](#resetStatistics)
14-
- [divisionSearchTeams](#divisionSearchTeams)
14+
- [divisionLoadTeams](#divisionLoadTeams)
1515

1616

1717
---
@@ -251,8 +251,8 @@ teamsnap.resetStatistics(1);
251251
---
252252

253253

254-
<a id="divisionSearchTeams"></a>
255-
## `divisionSearchTeams(params)`
254+
<a id="divisionLoadTeams"></a>
255+
## `divisionLoadTeams(params)`
256256
Search for teams in a division.
257257

258258
### Params
@@ -262,7 +262,7 @@ Search for teams in a division.
262262
```javascript
263263
// ~~~~~
264264
// Return all the active teams in a division
265-
teamsnap.divisionSearchTeams({divisionId: 1, isActive: true});
265+
teamsnap.divisionLoadTeams({divisionId: 1, isActive: true});
266266
```
267267

268268

lib/teamsnap.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,27 +1010,27 @@ exports.deleteDivision = function(division, callback) {
10101010
return this.deleteItem(division, callback);
10111011
};
10121012

1013-
exports.ancestorDivisions = function(divisionId, callback) {
1013+
exports.loadAncestorDivisions = function(divisionId, callback) {
10141014
if (!this.isId(divisionId)) {
1015-
throw new TSArgsError('teamsnap.loadDivision', 'divisionId must be provided');
1015+
throw new TSArgsError('teamsnap.loadAncestorDivisions', 'divisionId must be provided');
10161016
}
10171017
return this.collections.divisions.queryItems('ancestors', {
10181018
id: divisionId
10191019
}, callback);
10201020
};
10211021

1022-
exports.descendantDivisions = function(divisionId, callback) {
1022+
exports.loadDescendantDivisions = function(divisionId, callback) {
10231023
if (!this.isId(divisionId)) {
1024-
throw new TSArgsError('teamsnap.loadDivision', 'divisionId must be provided');
1024+
throw new TSArgsError('teamsnap.loadDescendantDivisions', 'divisionId must be provided');
10251025
}
10261026
return this.collections.divisions.queryItems('descendants', {
10271027
id: divisionId
10281028
}, callback);
10291029
};
10301030

1031-
exports.childrenDivisions = function(divisionId, callback) {
1031+
exports.loadChildDivisions = function(divisionId, callback) {
10321032
if (!this.isId(divisionId)) {
1033-
throw new TSArgsError('teamsnap.loadDivision', 'divisionId must be provided');
1033+
throw new TSArgsError('teamsnap.loadChildDivisions', 'divisionId must be provided');
10341034
}
10351035
return this.collections.divisions.queryItems('children', {
10361036
id: divisionId
@@ -1928,9 +1928,9 @@ exports.disableMember = function(memberId, callback) {
19281928
return this.collections.members.exec('disableMember', params).pop().callback(callback);
19291929
};
19301930

1931-
exports.divisionSearchMembers = function(params, callback) {
1931+
exports.divisionLoadMembers = function(params, callback) {
19321932
if (!params.divisionId) {
1933-
throw new TSArgsError('teamsnap.divisionSearchMembers', "`divisionId` must be provided");
1933+
throw new TSArgsError('teamsnap.divisionLoadMembers', "`divisionId` must be provided");
19341934
}
19351935
return this.collections.members.queryItems('divisionSearch', params, callback);
19361936
};
@@ -3212,9 +3212,9 @@ exports.resetStatistics = function(teamId, callback) {
32123212
return this.collections.teams.exec('resetStatistics', params).callback(callback);
32133213
};
32143214

3215-
exports.divisionSearchTeams = function(params, callback) {
3215+
exports.divisionLoadTeams = function(params, callback) {
32163216
if (!params.divisionId) {
3217-
throw new TSArgsError('teamsnap.divisionSearchTeams', "`divisionId` must be provided");
3217+
throw new TSArgsError('teamsnap.divisionLoadTeams', "`divisionId` must be provided");
32183218
}
32193219
return this.collections.teams.queryItems('divisionSearch', params, callback);
32203220
};

lib/teamsnap.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/test/js/test.js

Lines changed: 2 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -5322,120 +5322,11 @@ describe('Division Team Standings', function() {
53225322
});
53235323

53245324
require.register("test/divisions", function(exports, require, module) {
5325-
describe('Divisions', function() {
5326-
var childDivision, newDivision, rootDivision;
5327-
newDivision = null;
5328-
rootDivision = null;
5329-
childDivision = null;
5330-
before(function(done) {
5331-
rootDivision = teamsnap.createDivision({
5332-
name: 'Root Division',
5333-
sportId: 1,
5334-
country: 'United States',
5335-
postalCode: 80302,
5336-
timeZone: 'America/Denver',
5337-
parentId: 1
5338-
});
5339-
return teamsnap.saveDivision(rootDivision, function(err, result) {
5340-
expect(err).to.be["null"];
5341-
childDivision = teamsnap.createDivision({
5342-
name: 'Child Division',
5343-
sportId: 1,
5344-
parentId: rootDivision.id,
5345-
country: 'United States',
5346-
postalCode: 80302,
5347-
timeZone: 'America/Denver',
5348-
parentId: rootDivision.id
5349-
});
5350-
return teamsnap.saveDivision(childDivision, function(err, result) {
5351-
expect(err).to.be["null"];
5352-
return done();
5353-
});
5354-
});
5355-
});
5356-
after(function(done) {
5357-
return teamsnap.deleteDivision(childDivision, function(err, result) {
5358-
expect(err).to.be["null"];
5359-
return done();
5360-
});
5361-
});
5362-
after(function(done) {
5363-
if (newDivision) {
5364-
return teamsnap.deleteDivision(newDivision, function(err, result) {
5365-
expect(err).to.be["null"];
5366-
return done();
5367-
});
5368-
} else {
5369-
return done();
5370-
}
5371-
});
5372-
after(function(done) {
5373-
return teamsnap.deleteDivision(rootDivision, function(err, result) {
5374-
expect(err).to.be["null"];
5375-
return done();
5376-
});
5377-
});
5378-
it('should be able to create a new division', function(done) {
5379-
newDivision = teamsnap.createDivision({
5380-
name: 'New Test Division',
5381-
sportId: 1,
5382-
country: 'United States',
5383-
postalCode: 80302,
5384-
timeZone: 'America/Denver',
5385-
parentId: rootDivision.id
5386-
});
5387-
return teamsnap.saveDivision(newDivision, function(err, result) {
5388-
expect(err).to.be["null"];
5389-
return done();
5390-
});
5391-
});
5392-
it('should be able to load all divisions', function(done) {
5393-
return teamsnap.loadDivisions(function(err, result) {
5394-
expect(err).to.be["null"];
5395-
result.should.be.an('array');
5396-
return done();
5397-
});
5398-
});
5399-
it('should be able to load a division', function(done) {
5400-
return teamsnap.loadDivision(rootDivision.id, function(err, result) {
5401-
expect(err).to.be["null"];
5402-
result.should.be.an('object');
5403-
return done();
5404-
});
5405-
});
5406-
it('should be able to delete a division', function(done) {
5407-
return teamsnap.deleteDivision(newDivision, function(err, result) {
5408-
expect(err).to.be["null"];
5409-
newDivision = null;
5410-
return done();
5411-
});
5412-
});
5413-
it('should be able to return a divisions ancestors', function(done) {
5414-
return teamsnap.ancestorDivisions(childDivision.id, function(err, result) {
5415-
expect(err).to.be["null"];
5416-
result.should.be.an('array');
5417-
return done();
5418-
});
5419-
});
5420-
it('should be able to return a divisions descendants', function(done) {
5421-
return teamsnap.descendantDivisions(rootDivision.id, function(err, result) {
5422-
expect(err).to.be["null"];
5423-
result.should.be.an('array');
5424-
return done();
5425-
});
5426-
});
5427-
return it('should be able to return a divisions children', function(done) {
5428-
return teamsnap.childrenDivisions(rootDivision.id, function(err, result) {
5429-
expect(err).to.be["null"];
5430-
result.should.be.an('array');
5431-
return done();
5432-
});
5433-
});
5434-
});
5325+
54355326

54365327
});
54375328

5438-
require.register("test/eventStatistics", function(exports, require, module) {
5329+
;require.register("test/eventStatistics", function(exports, require, module) {
54395330
describe('Event Statistics', function() {
54405331
return it('should be able to load all event statistics for a team', function(done) {
54415332
return teamsnap.loadEventStatistics(team.id, function(err, result) {

lib/test/js/test.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)