<template>
    <form @submit.prevent="update">
        
<div class="form-group row">
    <div class="col-md-12">
        <label for="group_name">Group Name</label>
        <input type="hidden" name="group_id" id="group_id" v-model="fields.group_id">
        <input type="text" name="group_name" v-model="fields.group_name" class="form-control" placeholder="Enter group name...">
        <div v-if="errors && errors.group_name" class="text-danger">{{ errors.group_name[0] }}</div>
    </div>
    <div class="col-md-12">
        <label for="description">Description</label>
        <input type="text" name="description" v-model="fields.description" class="form-control" placeholder="">
        <div v-if="errors && errors.description" class="text-danger">{{ errors.description[0] }}</div>
    </div>
    
  
    </div>

    

        
    </form>
</template>

<script>
import FormMixin from '../shared/FormMixin';

export default {
  mixins: [ FormMixin ],
  props: ['groupdata'],
  data() {
    return {
      'action2': '/groups/updateGroup',
      'text': 'Group Updated succesfully',
      'redirect': '',
      fields: {
          group_id:this.groupdata.group_id,
          group_name:this.groupdata.group_name,
          description:this.groupdata.description,
 
      }
    }
  },
  mounted(){
          this.fields.group_id=this.groupdata.group_id;
          this.fields.group_name=this.groupdata.group_name;
          this.fields.description=this.groupdata.description;

      
  }
}

</script>