I defined a vue-resource:
resources.js:
import Vue from 'vue'
import VueResource from 'vue-resource'
Vue.use(VueResource);
export const Team = Vue.resource('team{/id}{/action}');
So, then if I call the get method on that resource:
api = require('.api/resources')
api.Team.get({
id: 3233,
action: 'details',
}).then(function(response) {
// ....
});
This ajax call makes a request to:
/team/3233/details
Problem:
But when I use .update
or .save
rather than .get
, the request url is not as expect:
api = require('.api/resources')
api.Team.update({
id: 3233,
action: 'details',
}).then(function(response) {
// ....
});
I only send a request to /team
with all parameters transferred in the request body.
How can I specifies the url parameters in such a .save
or .update
ajax call?