Commit 62a529f1 authored by anton's avatar anton
Browse files

Add page_size param

parent 62c50ae7
......@@ -44,6 +44,7 @@ const mediaFactory = function (env = {}) {
requestConfig.params = { query }
if (pagination) {
requestConfig.params.page = pagination.page
requestConfig.params.page_size = pagination.rowsPerPage
}
const response = await axios.get(`${context.rootState.settings.apiHost}videos/`, requestConfig)
const items = response.data.hits ? response.data.hits.map(item => {
......@@ -53,7 +54,7 @@ const mediaFactory = function (env = {}) {
rows: items,
rowsNumber: response.data.total_hits,
page: response.data.current_page,
rowsPerPage: Math.ceil(response.data.total_hits / response.data.total_pages)
rowsPerPage: response.data.page_size || pagination.rowsPerPage || Math.ceil(response.data.total_hits / response.data.total_pages)
}
},
async get (context, id) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment