1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
import Vue from 'vue'; import VueResource from 'vue-resource'; Vue.use(VueResource); export default class GroupsService { constructor(endpoint) { this.groups = Vue.resource(endpoint); } getGroups(parentId) { let data = {}; if (parentId) { data = { parent_id: parentId, }; } return this.groups.get(data); } }