Skip to content

Allow urlPath override for httpAdapter #25

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 12, 2015
Merged

Conversation

internalfx
Copy link
Member

This PR allows you to specify a urlPath option when running an async method.

Example:

store.filter('customer', myQueryParams, {urlPath: '/report/specialPath'}).then(function (result) {
  console.log(result)
})

@jmdobry
Copy link
Member

jmdobry commented Sep 12, 2015

@internalfx Can you please remove the changes to dist/* from your commit?

@internalfx
Copy link
Member Author

@jmdobry sure thing

if (method === 'find' || method === 'update' || method === 'destroy') {
args.push(id);
if (isString(options.urlPath)) {
return makePath.apply(DSUtils, [options.basePath || _this.defaults.basePath || resourceConfig.basePath].concat(options.urlPath.split('/')));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think you have to split options.urlPath, I think you can just make it the second item in the array passed to madePath.apply.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jmdobry I see now.

@jmdobry jmdobry changed the title Allow url override for httpAdapter Allow urlPath override for httpAdapter Sep 12, 2015
@internalfx
Copy link
Member Author

arrggg. I think I've now totally messed up my repo. Git is great until you need to change history. And I'm not that good at git.

@jmdobry
Copy link
Member

jmdobry commented Sep 12, 2015

How about I just throw your changes into a commit so I can cut a release?

@internalfx
Copy link
Member Author

@jmdobry got it.

jmdobry added a commit that referenced this pull request Sep 12, 2015
Allow urlPath override for httpAdapter
@jmdobry jmdobry merged commit 31a4129 into js-data:master Sep 12, 2015
@internalfx
Copy link
Member Author

I only see 1 commit. let me look

@jmdobry
Copy link
Member

jmdobry commented Sep 12, 2015

nope, refreshed

@internalfx
Copy link
Member Author

ok, cool

@internalfx
Copy link
Member Author

I also made your changes to the array

@jmdobry
Copy link
Member

jmdobry commented Sep 12, 2015

Needed to remove the .split too. I took care of it.

@internalfx
Copy link
Member Author

@jmdobry I'm also simultaneously migrating a chat server. Perhaps my attention was a little divided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants