blob: 2b861b6a4d5ae19193eccdb74cabbf74e71f2fe7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
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, page) {
const data = {};
if (parentId) {
data.parent_id = parentId;
// Do not send this param for sub groups
} else if (page) {
data.page = page;
}
return this.groups.get(data);
}
}
|