packages/udaru-core/lib/ops/teamOps.js
function deleteTeamMembers (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      const { id, organizationId } = params

      const tasks = [
        (job, next) => {
          Joi.validate({ id, organizationId }, validationRules.deleteTeamMembers, (err) => {
            if (err) return next(Boom.badRequest(err))

            next()
          })
        },
        (job, next) => {
          job.teamId = id
          job.organizationId = organizationId

          next()
        },
        checkTeamExists,
        deleteTeamUsers
      ]

      db.withTransaction(tasks, (err, res) => {
        if (err) return cb(err)
        cb()
      })

      return promise
    }
function deleteTeamMembers (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      const { id, organizationId } = params

      const tasks = [
        (job, next) => {
          Joi.validate({ id, organizationId }, validationRules.deleteTeamMembers, (err) => {
            if (err) return next(Boom.badRequest(err))

            next()
          })
        },
        (job, next) => {
          job.teamId = id
          job.organizationId = organizationId

          next()
        },
        checkTeamExists,
        deleteTeamUsers
      ]

      db.withTransaction(tasks, (err, res) => {
        if (err) return cb(err)
        cb()
      })

      return promise
    }
function deleteTeamMembers ( params , cb ) { let promise = null if ( typeof cb !== 'function' ) [ promise , cb ] = asyncify ( ) const { id , organizationId } = params const tasks = [ ( job , next ) => { Joi . validate ( { id , organizationId } , validationRules . deleteTeamMembers , ( err ) => { if ( err ) return next ( Boom . badRequest ( err ) ) next ( ) } ) } , ( job , next ) => { job . teamId = id job . organizationId = organizationId next ( ) } , checkTeamExists , deleteTeamUsers ] db . withTransaction ( tasks , ( err , res ) => { if ( err ) return cb ( err ) cb ( ) } ) return promise }
Delete team members

@param  {Object}   params { id, organizationId }
@param  {Function} cb
Delete team members