add preview&Sorting menu for mobile version, refacoring sorting URI

This commit is contained in:
Milos Holba
2020-12-09 18:24:05 +01:00
parent 7e325c5101
commit c3d162b991
11 changed files with 560 additions and 60 deletions

View File

@@ -11,13 +11,10 @@ const defaultState = {
const actions = {
getAppData: ({commit, getters}) => {
let getSort = JSON.parse(localStorage.getItem('sorting'))
let sorting = {sort : getSort ? getSort.sort : 'DESC' , field:getSort ? getSort.field : 'created_at'}
let sortingUrl = '?sort=' + sorting.field + '&direction=' + sorting.sort
return new Promise((resolve, reject) => {
axios
.get(getters.api + '/user' + sortingUrl)
.get(getters.api + '/user' + getters.sorting.URI)
.then((response) => {
resolve(response)