$ Ressource gibt mir Alpträume. Im Moment habe ich so etwas in meinem Dienst:
makeCall: function(auth, data, new, old){
return this.resource(auth).putRequest({id: data.id, thing1: new, thing2: old}).$promise
}
resource: function(auth){
return(
$resource(config.url, {id: '@id'}, {
putRequest: {
method: 'PUT',
params: {thing1: '@thing1', thing2: '@thing2'},
url: config.url + '/user/:id/update'
headers: {authorization: auth}
})
);
Dieser sendet eine PUT-Anfrage an die URL wie gewünscht, mit der id-Parameter richtig eingestellt werden. Das Problem ist jedoch, dass die ID auch in der Payload erscheint, wenn die Payload nur aus ding1 und ding2 bestehen muss.