-
-
Save shwoodard/3e7a314015daef71f97f to your computer and use it in GitHub Desktop.
Adding parameters to query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import ApplicationAdapter from 'london-waits/pods/application/adapter'; | |
import config from 'london-waits/config/environment'; | |
function readStopId(id) { | |
return id.split(':')[0]; | |
} | |
export default ApplicationAdapter.extend({ | |
pathForType(type) { | |
Ember.assert(`Expected type='stop'. Got ${type}`, type === 'stop'); | |
return 'StopPoint'; | |
}, | |
findRecord(store, type, id) { | |
id = readStopId(id); | |
return this._super(store, type, id); | |
}, | |
query: function(store, type, query) { | |
Ember.$.extend(query, { | |
stopTypes: 'NaptanPublicBusCoachTram,NaptanRailEntrance,NaptanMetroStation', | |
modes: 'bus,overground,dlr,tube', | |
useStopPointHierarchy: false, | |
includeChildren: false, | |
returnLines: true, | |
radius: config.APP.vicinityRadius, | |
}); | |
this._super.apply(this, arguments); | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment