Rename storePagination to setPagination
This commit is contained in:
parent
6483bc8ca6
commit
ac71013642
3 changed files with 3 additions and 3 deletions
|
@ -85,7 +85,7 @@ module.exports = Vue.component('environment-component', {
|
||||||
this.store.storeAvailableCount(response.body.available_count);
|
this.store.storeAvailableCount(response.body.available_count);
|
||||||
this.store.storeStoppedCount(response.body.stopped_count);
|
this.store.storeStoppedCount(response.body.stopped_count);
|
||||||
this.store.storeEnvironments(response.body.environments);
|
this.store.storeEnvironments(response.body.environments);
|
||||||
this.store.storePagination(response.headers);
|
this.store.setPagination(response.headers);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
|
|
@ -43,7 +43,7 @@ class EnvironmentsStore {
|
||||||
return filteredEnvironments;
|
return filteredEnvironments;
|
||||||
}
|
}
|
||||||
|
|
||||||
storePagination(pagination = {}) {
|
setPagination(pagination = {}) {
|
||||||
const normalizedHeaders = gl.utils.normalizeHeaders(pagination);
|
const normalizedHeaders = gl.utils.normalizeHeaders(pagination);
|
||||||
const paginationInformation = {
|
const paginationInformation = {
|
||||||
perPage: parseInt(normalizedHeaders['X-PER-PAGE'], 10),
|
perPage: parseInt(normalizedHeaders['X-PER-PAGE'], 10),
|
||||||
|
|
|
@ -50,7 +50,7 @@ const { environmentsList } = require('./mock_data');
|
||||||
previousPage: 2,
|
previousPage: 2,
|
||||||
};
|
};
|
||||||
|
|
||||||
store.storePagination(pagination);
|
store.setPagination(pagination);
|
||||||
expect(store.state.paginationInformation).toEqual(expectedResult);
|
expect(store.state.paginationInformation).toEqual(expectedResult);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue