Namespace: Team

Team

Model for teams that collaborate on reviews of a certain type. A team can also publish blog posts. Teams can be open for anyone, or require moderator approval for new members. This model is versioned.

Source:

Methods

(async, static) getWithData(id, optionsopt) → {Team}

Retrieve a team and some of the joined data like reviews or members

Parameters:
Name Type Attributes Description
id String

the team to look up

options Object <optional>

query critera

Properties
Name Type Default Description
withMembers Boolean true

get the user objects (with hashed password) representing the members

withModerators Boolean true

get the user objects (with hashed password) representing the moderators

withJoinRequests Boolean true

get the pending requests to join this team

withJoinRequestDetails Boolean false

further down the rabbit hole, also get the user objects (with hashed password) for those requests

withReviews Boolean false

get reviews associated with this team, and the users (with hashed password) who authored them

reviewLimit Number 1

get up to this number of reviews

reviewOffsetDate Date

only get reviews older than this date

Source:
Returns:
Type
Team

populateUserInfo(user)

Populate the virtual permission and metadata fields for this team with information for a given user. This includes properties like userIsMember and userIsModerator.

Parameters:
Name Type Description
user User

whose permissions and metadata to use to populate the fields

Source: