-
-
Save chudaol/d5176b88ba2c5799c0b7b0dd33ac0426 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import VueResource from 'vue-resource' | |
Vue.use(VueResource) | |
const ShoppingListsResource = Vue.resource('http://localhost:3000/' + 'shoppinglists{/id}') | |
export default { | |
fetchShoppingLists: () => { | |
return ShoppingListsResource.get() | |
}, | |
addNewShoppingList: (data) => { | |
return ShoppingListsResource.save(data) | |
}, | |
updateShoppingList: (data) => { | |
return ShoppingListsResource.update({ id: data.id }, data) | |
}, | |
deleteShoppingList: (id) => { | |
return ShoppingListsResource.remove({ id: id }) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment