<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>

        <div class="form-group">
            <button type="submit" class="btn btn-success btn-round">Save</button>
            <button type="reset" class="btn btn-danger btn-round">Clear</button>
        </div>       
        

        
    </form>
</template>

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

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

      
  }
}

</script>