Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

[angular-resource 1.2.26]: $resource delete call removes leading slash when query param has a "." #10438

@pmariduena

Description

@pmariduena

Hello.

I'm trying to call a delete service....here is the service:

myServices.factory('myService', ['$resource',
function ($resource) {
return $resource('app/service/:name', {name: '@name'}, {
// whether a GET, PUT, POST, or DELETE, set isArray: true is the response body from the
// server contains something that converts to an array. Otherwise, the request will be processed, but
// you will encounter errors.
query: {method: 'GET', isArray: true},
addItem: {method: 'POST', isArray: true},
updateAll: {method: 'PUT', isArray: true},
removeItem: {method: 'DELETE'}
});
}]);

from my angular JS controller, I'm making this call:
...
// rowEntity.name === ".PPM"
var deferred = myService.removeItem({name: rowEntity.name});
...

I expect in my browser to see a call to DELETE "/app/service/.PPM", however, it's failing with a 404, and I'm seeing this call being made:

DELETE "/app/service.PPM"

It's eating the slash after the service for no apparent reason...can you help me?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions