Skip to content
Snippets Groups Projects
Commit 15c0a6d8 authored by Alfredo Sumaran's avatar Alfredo Sumaran
Browse files

Set pagination only when loading the app

parent 72c9454e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -33,6 +33,7 @@ $(() => {
methods: {
fetchGroups(parentGroup) {
let parentId = null;
let getGroups = null;
 
if (parentGroup) {
parentId = parentGroup.id;
Loading
Loading
@@ -40,14 +41,15 @@ $(() => {
 
const page = gl.utils.getParameterByName('page');
 
service.getGroups(parentId, page)
.then((response) => {
store.setGroups(response.json(), parentGroup);
store.storePagination(response.headers);
})
.catch(() => {
// TODO: Handler error
});
getGroups = service.getGroups(parentId, page);
getGroups.then((response) => {
store.setGroups(response.json(), parentGroup);
})
.catch(() => {
// TODO: Handler error
});
return getGroups;
},
toggleSubGroups(parentGroup = null) {
if (!parentGroup.isOpen) {
Loading
Loading
@@ -57,10 +59,18 @@ $(() => {
},
},
created() {
const groupFilterList = new GroupFilterableList(form, filter, holder, store);
let groupFilterList = null;
groupFilterList = new GroupFilterableList(form, filter, holder, store);
groupFilterList.initSearch();
 
this.fetchGroups();
this.fetchGroups()
.then((response) => {
store.storePagination(response.headers);
})
.catch(() => {
// TODO: Handle error
});
 
eventHub.$on('toggleSubGroups', this.toggleSubGroups);
},
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment