Guest User

Comments

a guest
Mar 9th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. import axios from "axios";
  2.  
  3. export const getComments = function (store, model, id) {
  4. return axios.get('/api/comments', {params: {id: id, type: model}}).then((response) => {
  5. store.dispatch('ADD_COMMENTS', response.data)
  6. })
  7. }
  8.  
  9. export const addComment = function (store, comment) {
  10. comments._token = 'j0QqSiZryRYTTdK42HZbm5GfN9NJShNC2b7lA67K'
  11. return axios.post('/api/comments', comment).then((response) => {
  12. store.dispatch('ADD_COMMENT', response.data)
  13. })
  14. }
Add Comment
Please, Sign In to add comment