<template>
  <v-card flat>
    <v-card-text>
      <dougal-organisations
        :self="user"
        :organisations.sync="organisations_"
      >
        <template v-slot:actions>
          <v-spacer></v-spacer>
          <v-btn
            color="secondary"
            @click="back"
          >Back</v-btn>
        </template>
      </dougal-organisations>
    </v-card-text>
    <v-card-actions>
    </v-card-actions>
  </v-card>
</template>

<script>
import { mapActions, mapGetters } from 'vuex'
import DougalOrganisations from '../organisations'


export default {
  name: "DougalProjectSettingsOrganisations",

  components: {
    DougalOrganisations
  },

  props: {
    organisations: Object,
    value: Object
  },

  data () {
    return {
    }
  },

  computed: {

    organisations_: {
      get () {
        return this.organisations;
      },

      set (v) {
        this.$emit("input", {
          ...this.value,
          organisations: v.toJSON()
        });
      }
    },

    ...mapGetters(['user', 'loading', 'serverEvent'])
  },

  methods: {

    reset () {
    },

    save () {
    },

    back () {
      this.$emit('close');
    }

  },

  mounted () {
    this.reset();
  }

}
</script>
