Skip to content

Commit

Permalink
rename serviceConstructGetXhrUri to service.constructGetXhrUri
Browse files Browse the repository at this point in the history
  • Loading branch information
lingyan committed Jun 2, 2015
1 parent 5af80cc commit cbe4051
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions lib/fetchr-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@ module.exports = function fetchrPlugin(options) {
create: crudProxy(service, 'create', serviceMeta),
read: crudProxy(service, 'read', serviceMeta),
update: crudProxy(service, 'update', serviceMeta),
'delete': crudProxy(service, 'delete', serviceMeta)
'delete': crudProxy(service, 'delete', serviceMeta),
constructGetXhrUri: function constructGetXhrUri(resource, params, config) {
config = config || {};
var getUriFn = config.constructGetUri || defaultConstructGetUri;
return getUriFn.call(service, xhrPath, resource, params, config, xhrContext);
}
};
actionContext.getServiceMeta = function getServiceMeta() {
return serviceMeta;
};
actionContext.serviceConstructGetXhrUri = function serviceConstructGetXhrUri(resource, params, config) {
config = config || {};
var getUriFn = config.constructGetUri || defaultConstructGetUri;
return getUriFn.call(service, xhrPath, resource, params, config, xhrContext);
};
},
/**
* Called to dehydrate plugin options
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/lib/fetchr-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ describe('fetchrPlugin', function () {
});
contextPlug.plugActionContext(actionContext);

expect(actionContext.serviceConstructGetXhrUri(
expect(actionContext.service.constructGetXhrUri(
'resourceFoo',
{a: 1}
)).to.equal('custom2/api/resourceFoo;a=1?device=tablet', 'default construct uri function');

expect(actionContext.serviceConstructGetXhrUri(
expect(actionContext.service.constructGetXhrUri(
'resourceFoo',
{a: 1},
{
Expand Down

0 comments on commit cbe4051

Please sign in to comment.