-
Notifications
You must be signed in to change notification settings - Fork 0
Community Application: Teams
NateFerrero edited this page Sep 25, 2011
·
2 revisions
Code:
e.app.community.teams( function(err, teams) {
teams.forEach( function(team) {
// Do something with each team here
} );
} );Returned Values for variable teams:
| Variable | Contents | Description |
|---|---|---|
| teams.items | [Team, Team, ...] | Array of teams, up to the amount per page (default 10). |
| teams._next | Function | Call this to load the next page of teams automatically. |
| teams._prev | Function | Call this to load the previous page of teams automatically. |
| teams._page(page) | Function | Call this to load a specific page of teams automatically. |
| teams.count | 10 | The number of teams on the current page. |
| teams.paging | Object
|
Paging information
|
Code:
e.app.community.team(43, function(err, team) {
// Do something with the team here
} );Get an individual team like that, or using the list as previously demonstrated.
Returned Values for variable team:
| Variable | Contents | Description |
|---|---|---|
| team.id | 43 | ID of the team. |
| team.name | Bob's BBQ Fundraiser | Name of the team. |
| team.description | Let's get together to enjoy a BBQ and end global poverty! | Short description of the team. |
| team.href | //live58.donate.io/momentum/team/43 | URL of the team page. |
| team.link | <a href="//live58.donate.io/momentum/team/43">Bob's BBQ Fundraiser</a> | HTML link to the team page. |
| team.progress | 120.00 | Progress of the team in dollars. |
| team.target | 350.00 | Target of the team in dollars. |
| team.photo | /portal/photo/team/43 | A URL containing the location of the team photo. |
| team.project | Project | Contains the most recent project associated with the team. See the Projects API Reference for more details. |
| team.completed_projects(callback) | [Project, Project, ...] | Contains all of the projects that the team funded at least partially. See the Projects API Reference for more details. |