janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
241 stars 58 forks source link

Fix ID property missing last character when using `.ref` and `.removeRef` #61

Closed zhevron closed 6 years ago

zhevron commented 6 years ago

After the fix to remove trailing slashes, the .ref and .removeRef methods still removes the last character.

This results in URLs looking like this: http://services.odata.org/v4/TripPinServiceRW/People('myusername')/$ref?$id=http://services.odata.org/v4/TripPinServiceRW/People('otherusername'

This PR simply removes the .substring call when adding the resource ID to the request.

Let me know if you want this fixed some other way. Considering #60, this might not be a permanent fix anyway.

janhommes commented 6 years ago

Merged. Was due the changes for #51. Maybe tests for that would be nice....

kenken023 commented 6 years ago

Good day,

Can you please update the node package for this? Thanks in advance. :) https://www.npmjs.com/package/odata

janhommes commented 6 years ago

@kenken023 done.