create stubs for filter store
This commit is contained in:
parent
eec69c1e19
commit
d5c5ca37b3
|
@ -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 => {
|
||||||
|
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
export const getQuery = state => {
|
||||||
|
return state.query;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const getCollection = state => {
|
||||||
|
return state.collection;
|
||||||
|
}
|
|
@ -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
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
export const setQuery = ( state, query ) => {
|
||||||
|
state.query = query;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const setCollection = ( state, collection ) => {
|
||||||
|
state.query = collection;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue