|
@@ -0,0 +1,48 @@
|
|
|
|
+import * as types from '../../types';
|
|
|
|
+
|
|
|
|
+export default {
|
|
|
|
+ [types.FETCH_DISTRIBUTORS]: ({commit}) => {
|
|
|
|
+ // TODO: Remove this mocked data
|
|
|
|
+ const distributors = [
|
|
|
|
+ {
|
|
|
|
+ "id": 1,
|
|
|
|
+ "title": "Charton Hobbes",
|
|
|
|
+ "notes": "",
|
|
|
|
+ "contacts": [
|
|
|
|
+ {
|
|
|
|
+ "uuid": "44490103-92B7-4712-B494-E65878E6B0DC",
|
|
|
|
+ "email": "abc@wisksolutions.com",
|
|
|
|
+ "date": "2018-02-28T05:01:26Z",
|
|
|
|
+ "name": "ABC"
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "uuid": "E7AD1046-3293-4F41-910C-63A198C9D3B6",
|
|
|
|
+ "email": "efg@wisksolutions.com",
|
|
|
|
+ "date": "2018-02-28T05:01:26Z",
|
|
|
|
+ "name": "EFG"
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ "id": 2,
|
|
|
|
+ "title": "Bob Marley",
|
|
|
|
+ "notes": "Something",
|
|
|
|
+ "contacts": [
|
|
|
|
+ {
|
|
|
|
+ "uuid": "44490103-92B7-4712-B494-E65878E6B0DC",
|
|
|
|
+ "email": "abc@wisksolutions.com",
|
|
|
|
+ "date": "2018-02-28T05:01:26Z",
|
|
|
|
+ "name": "ABC"
|
|
|
|
+ }
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ ]
|
|
|
|
+ commit(types.UPDATE_DISTRIBUTORS, distributors)
|
|
|
|
+ },
|
|
|
|
+ [types.CLEAR_DISTRIBUTORS]: ({commit}) => {
|
|
|
|
+ commit(types.UPDATE_DISTRIBUTORS, []);
|
|
|
|
+ },
|
|
|
|
+ [types.GET_DISTRIBUTOR]: ({commit}, payload) => {
|
|
|
|
+ commit(types.UPDATE_DISTRIBUTOR, payload);
|
|
|
|
+ },
|
|
|
|
+};
|