packages/udaru-core/lib/ops/teamOps.js
function readTeamUsers ({ id, page = 1, limit, organizationId }, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      Joi.validate({ id, page, limit, organizationId }, validationRules.readTeamUsers, function (err) {
        if (err) return cb(Boom.badRequest(err))

        const pageLimit = limit || _.get(config, 'authorization.defaultPageSize')
        const offset = (page - 1) * pageLimit

        const job = {
          id: id,
          organizationId: organizationId,
          offset: offset,
          limit: pageLimit,
          team: {},
          client: db
        }

        loadTeamUsers(job, (err) => {
          if (err) return cb(err)
          const pageSize = pageLimit || job.totalUsersCount
          const result = {
            page: page,
            limit: pageSize,
            total: job.totalUsersCount,
            data: job.team.users
          }
          return cb(null, result)
        })
      })

      return promise
    }
function readTeamUsers ({ id, page = 1, limit, organizationId }, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      Joi.validate({ id, page, limit, organizationId }, validationRules.readTeamUsers, function (err) {
        if (err) return cb(Boom.badRequest(err))

        const pageLimit = limit || _.get(config, 'authorization.defaultPageSize')
        const offset = (page - 1) * pageLimit

        const job = {
          id: id,
          organizationId: organizationId,
          offset: offset,
          limit: pageLimit,
          team: {},
          client: db
        }

        loadTeamUsers(job, (err) => {
          if (err) return cb(err)
          const pageSize = pageLimit || job.totalUsersCount
          const result = {
            page: page,
            limit: pageSize,
            total: job.totalUsersCount,
            data: job.team.users
          }
          return cb(null, result)
        })
      })

      return promise
    }
function readTeamUsers ( { id , page = 1 , limit , organizationId } , cb ) { let promise = null if ( typeof cb !== 'function' ) [ promise , cb ] = asyncify ( ) Joi . validate ( { id , page , limit , organizationId } , validationRules . readTeamUsers , function ( err ) { if ( err ) return cb ( Boom . badRequest ( err ) ) const pageLimit = limit || _ . get ( config , 'authorization.defaultPageSize' ) const offset = ( page - 1 ) * pageLimit const job = { id : id , organizationId : organizationId , offset : offset , limit : pageLimit , team : { } , client : db } loadTeamUsers ( job , ( err ) => { if ( err ) return cb ( err ) const pageSize = pageLimit || job . totalUsersCount const result = { page : page , limit : pageSize , total : job . totalUsersCount , data : job . team . users } return cb ( null , result ) } ) } ) return promise }
Fetch the users data from a team

@param  {params}   params { id, page, limit }
@param  {Function} cb
Fetch the users data from a team