@@ -1243,13 +1243,10 @@ module.provider('Restangular', function() {
1243
1243
1244
1244
function addRestangularMethodFunction ( name , operation , path , defaultParams , defaultHeaders , defaultElem ) {
1245
1245
var newRestangularObject ,
1246
- createdFunction ;
1246
+ createdFunction ,
1247
+ urlBuilder = operation === 'getList' ? 'all' : 'one' ;
1247
1248
1248
- if ( operation === 'getList' ) {
1249
- newRestangularObject = this . all ( path ) ;
1250
- } else {
1251
- newRestangularObject = this . one ( path ) ;
1252
- }
1249
+ newRestangularObject = this [ urlBuilder ] ( path ) ;
1253
1250
1254
1251
createdFunction = function ( params , headers , elem ) {
1255
1252
var params , headers , elem ;
@@ -1258,7 +1255,15 @@ module.provider('Restangular', function() {
1258
1255
headers = _ . defaults ( headers , defaultHeaders ) ;
1259
1256
elem = _ . defaults ( elem , defaultElem ) ;
1260
1257
1261
- return newRestangularObject [ operation ] ( params , headers , elem ) ;
1258
+ return newRestangularObject . customOperation (
1259
+ // umm, so the documentation specifies delete is one of the operations
1260
+ // that can be pased to customOperation, but it totally means remove?
1261
+ operation === 'delete' ? 'remove' : operation ,
1262
+ '' ,
1263
+ params ,
1264
+ headers ,
1265
+ elem
1266
+ ) ;
1262
1267
} ;
1263
1268
1264
1269
if ( config . isSafe ( operation ) ) {
0 commit comments