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

      db.withTransaction([
        (job, next) => {
          const { id, organizationId } = params

          Joi.validate({ id, organizationId }, validationRules.deleteTeam, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.teamId = params.id
          job.organizationId = params.organizationId
          next()
        },
        loadTeamDescendants,
        deleteTeamsMembers,
        deleteTeamsPolicies,
        readDefaultPoliciesIds,
        deleteDefaultPolicies,
        removeTeams
      ], (err) => {
        if (err) return cb(err)
        cb()
      })

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

      db.withTransaction([
        (job, next) => {
          const { id, organizationId } = params

          Joi.validate({ id, organizationId }, validationRules.deleteTeam, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.teamId = params.id
          job.organizationId = params.organizationId
          next()
        },
        loadTeamDescendants,
        deleteTeamsMembers,
        deleteTeamsPolicies,
        readDefaultPoliciesIds,
        deleteDefaultPolicies,
        removeTeams
      ], (err) => {
        if (err) return cb(err)
        cb()
      })

      return promise
    }
function deleteTeam ( params , cb ) { let promise = null if ( typeof cb !== 'function' ) [ promise , cb ] = asyncify ( ) db . withTransaction ( [ ( job , next ) => { const { id , organizationId } = params Joi . validate ( { id , organizationId } , validationRules . deleteTeam , ( err ) => { if ( err ) return next ( Boom . badRequest ( err ) ) next ( ) } ) } , ( job , next ) => { job . teamId = params . id job . organizationId = params . organizationId next ( ) } , loadTeamDescendants , deleteTeamsMembers , deleteTeamsPolicies , readDefaultPoliciesIds , deleteDefaultPolicies , removeTeams ] , ( err ) => { if ( err ) return cb ( err ) cb ( ) } ) return promise }
Delete specific team

@param  {Object}   params { id, organizationId }
@param  {Function} cb     [description]
Delete specific team