mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 23:29:35 +02:00
20 lines
442 B
JavaScript
20 lines
442 B
JavaScript
import {getHeaders} from './header.js';
|
|
|
|
const formatLocationsReq = (ctx, query) => {
|
|
const {profile, opt} = ctx;
|
|
|
|
return {
|
|
endpoint: profile.locationsEndpoint,
|
|
body: {
|
|
locationTypes: profile.formatLocationFilter(opt.stops, opt.addresses, opt.poi),
|
|
searchTerm: query,
|
|
maxResults: opt.results,
|
|
},
|
|
headers: getHeaders('application/x.db.vendo.mob.location.v3+json'),
|
|
method: 'post',
|
|
};
|
|
};
|
|
|
|
export {
|
|
formatLocationsReq,
|
|
};
|