Skip to content

Community Application: Teams

NateFerrero edited this page Sep 25, 2011 · 2 revisions

Community Application: Teams

List of Teams

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
  • has_next: true
  • has_prev: false
  • items: 100
  • length: 10
  • page: 1
  • pages: 10
Paging information
  • Is there a next page?
  • Is there a previous page?
  • Total items in the list.
  • Length of a single page
  • Current page number.
  • How many pages there are.

Single Team

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="http://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.
Clone this wiki locally