create stubs for filter store

This commit is contained in:
Eduardo humberto 2018-02-27 14:22:40 -03:00
parent eec69c1e19
commit d5c5ca37b3
4 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import axios from '../../../axios/axios';
import qs from 'qs';
export const do_query = ({ commit, state }) => {
return new Promise((resolve, reject) =>{
axios.get('/collections/' + state.collection + '/items?' + qs.stringify( state.query ))
.then(res => {
})
.catch(error => {
})
});
}

View File

@ -0,0 +1,7 @@
export const getQuery = state => {
return state.query;
}
export const getCollection = state => {
return state.collection;
}

View File

@ -0,0 +1,16 @@
import * as actions from './actions';
import * as getters from './getters';
import * as mutations from './mutations';
const state = {
query: {},
collection: null
};
export default {
namespaced: true,
state,
mutations,
actions,
getters
}

View File

@ -0,0 +1,8 @@
export const setQuery = ( state, query ) => {
state.query = query;
}
export const setCollection = ( state, collection ) => {
state.query = collection;
}