Skip to content
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

new lyft.Location creates class error #9

Open
dlinnell2 opened this issue May 15, 2018 · 0 comments
Open

new lyft.Location creates class error #9

dlinnell2 opened this issue May 15, 2018 · 0 comments

Comments

@dlinnell2
Copy link

import lyft from 'node-lyft';
let defaultClient = lyft.ApiClient.instance;

// Configure OAuth2 access token for authorization: User Authentication
let userAuth = defaultClient.authentications['User Authentication'];
userAuth.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new lyft.UserApi();

let request = new lyft.Ride('lyft', new lyft.Location(37.77663, -122.39227));
request.destination = new lyft.Location(37.771, -122.39123);

apiInstance.newRide(request).then((data) => {
console.log('API called successfully. Returned data: ' + data);
}, (error) => {
console.error(error);
});

Pulled above code from Lyft API endpoints page, received following error

TypeError: Cannot call a class as a function
at _classCallCheck (/Users/dlinnell/Desktop/Helios/node_modules/node-lyft/lib/model/LatLng.js:26:99)
at Location.LatLng (/Users/dlinnell/Desktop/Helios/node_modules/node-lyft/lib/model/LatLng.js:43:9)
at new Location (/Users/dlinnell/Desktop/Helios/node_modules/node-lyft/lib/model/Location.js:55:26)
at Request._callback (/Users/dlinnell/Desktop/Helios/routes/lyft_routes.js:62:35)
at Request.self.callback (/Users/dlinnell/Desktop/Helios/node_modules/request/request.js:186:22)
at emitTwo (events.js:125:13)
at Request.emit (events.js:213:7)
at Request. (/Users/dlinnell/Desktop/Helios/node_modules/request/request.js:1163:10)
at emitOne (events.js:115:13)
at Request.emit (events.js:210:7)

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

No branches or pull requests

1 participant