module.exports = {


    friendlyName: 'Disable',
  
  
    description: 'Disable user.',
  
  
    inputs: {
      user:{
        type:'number',
        required: true
      },
      statutCompte:{
        type:'boolean',
        
      },
      
    },
  
  
    exits: {
      notFound:{
        statusCode:404
      },
  
    },
  
  
    fn: async function (inputs,exits) {
  
      let user = await User.findOne(inputs.user)
      if(!user){
        return exits.notFound({message:"User  not found"})
      }
  
      let disableUser = await User.update({id: user.id}, {statusCompte: false},).fetch()
  
    
      // All done.
      return exits.success({
        ...disableUser,
      });
  
    }
  
  };
  