janhommes / o.js

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

Library builds bad urls for olingo v4 #36

Closed ieugen closed 7 years ago

ieugen commented 8 years ago

Hello,

I'm using this library to request data from a java server with olingo v4

o().config({
  endpoint: '/api'
})

o('ShopWebsites').get(function (data) {
  console.log(`Data is {data}`)
})

I get this

o.js:1384 GET http://localhost:3000/api/ShopWebsites/?$format=json 400 (Bad Request)

The request is bad because it adds the last slash after ShopWebsites . If I make the request like: /api/ShopWebsites?$format=json it works.

ieugen commented 8 years ago

This fixes the request:

https://github.com/netdava/o.js/commit/55a0038b6e8b9bffc6f9a5262bbe3d5e76547559

andriy-f commented 7 years ago

maybe make a pull request?

janhommes commented 7 years ago

Closed with v0.3.1