Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import axios from "axios";
- export const getComments = function (store, model, id) {
- return axios.get('/api/comments', {params: {id: id, type: model}}).then((response) => {
- store.dispatch('ADD_COMMENTS', response.data)
- })
- }
- export const addComment = function (store, comment) {
- comments._token = 'j0QqSiZryRYTTdK42HZbm5GfN9NJShNC2b7lA67K'
- return axios.post('/api/comments', comment).then((response) => {
- store.dispatch('ADD_COMMENT', response.data)
- })
- }
Add Comment
Please, Sign In to add comment