module.exports = {


    friendlyName: 'Enable',
  
  
    description: 'Enable 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 enableUser = await User.update({id: user.id}, {statusCompte: true},).fetch()
  
    
      // All done.
      return exits.success({
        ...enableUser,
      });
  
    }
  
  };
  