packages/udaru-core/lib/ops/teamOps.js
function readTeam ({ id, organizationId }, cb) {
      const job = {
        team: {}
      }

      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      async.applyEachSeries([
        (job, next) => {
          Joi.validate({ id, organizationId }, validationRules.readTeam, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.client = db
          job.id = id
          job.organizationId = organizationId
          next()
        },
        loadTeams,
        loadTeamUsers,
        loadTeamPolicies
      ], job, (err) => {
        if (err) return cb(err)
        return cb(null, job.team)
      })

      return promise
    }
function readTeam ({ id, organizationId }, cb) {
      const job = {
        team: {}
      }

      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      async.applyEachSeries([
        (job, next) => {
          Joi.validate({ id, organizationId }, validationRules.readTeam, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.client = db
          job.id = id
          job.organizationId = organizationId
          next()
        },
        loadTeams,
        loadTeamUsers,
        loadTeamPolicies
      ], job, (err) => {
        if (err) return cb(err)
        return cb(null, job.team)
      })

      return promise
    }
function readTeam ( { id , organizationId } , cb ) { const job = { team : { } } let promise = null if ( typeof cb !== 'function' ) [ promise , cb ] = asyncify ( ) async . applyEachSeries ( [ ( job , next ) => { Joi . validate ( { id , organizationId } , validationRules . readTeam , ( err ) => { if ( err ) return next ( Boom . badRequest ( err ) ) next ( ) } ) } , ( job , next ) => { job . client = db job . id = id job . organizationId = organizationId next ( ) } , loadTeams , loadTeamUsers , loadTeamPolicies ] , job , ( err ) => { if ( err ) return cb ( err ) return cb ( null , job . team ) } ) return promise }
Fetch specific team data

@param  {params}   params { id, organizationId }
@param  {Function} cb
Fetch specific team data