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

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

        const offset = (page - 1) * limit
        const job = {
          id,
          organizationId,
          offset,
          limit,
          user: {},
          client: db
        }

        readUserTeams(job, (err) => {
          if (err) return cb(err)

          return cb(null, job.user.teams, job.totalTeamsCount)
        })
      })

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

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

        const offset = (page - 1) * limit
        const job = {
          id,
          organizationId,
          offset,
          limit,
          user: {},
          client: db
        }

        readUserTeams(job, (err) => {
          if (err) return cb(err)

          return cb(null, job.user.teams, job.totalTeamsCount)
        })
      })

      return promise
    }
function listUserTeams ( { id , organizationId , page = 1 , limit } , cb ) { let promise = null if ( typeof cb !== 'function' ) [ promise , cb ] = asyncify ( 'data' , 'total' ) Joi . validate ( { id , organizationId , page , limit } , validationRules . listUserTeams , function ( err ) { if ( err ) return cb ( Boom . badRequest ( err ) ) const offset = ( page - 1 ) * limit const job = { id , organizationId , offset , limit , user : { } , client : db } readUserTeams ( job , ( err ) => { if ( err ) return cb ( err ) return cb ( null , job . user . teams , job . totalTeamsCount ) } ) } ) return promise }
List the teams to which the user belongs to
Does not go recursively to parent teams

@param  {Object}   params { id, organizationId, limit, page }
@param  {Function} cb
List the teams to which the user belongs to Does not go recursively to parent teams