added axios, datarest, vuex

This commit is contained in:
2019-04-02 12:59:58 +02:00
parent 1017ecdc95
commit 8dd21b9e2d
11 changed files with 177 additions and 21 deletions
+22
View File
@@ -0,0 +1,22 @@
import { HTTP } from './http-axios'
// import { store } from 'modules/data/store'
export default {
getPosts (cb) {
HTTP.get('posts')
.then(response => {
console.log('response', response)
cb(response.data)
})
},
getPost (id, cb) {
HTTP.get(`posts/` + id)
.then(response => {
console.log('response', response)
cb(response.data)
})
.catch(e => {
this.errors.push(e)
})
}
}