bahnui/back/node_modules/hafas-client/format/refresh-journey-req.js
2024-11-15 23:23:46 +01:00

25 lines
477 B
JavaScript

const formatRefreshJourneyReq = (ctx, refreshToken) => {
const {profile, opt} = ctx;
const req = {
getIST: true, // todo: make an option
getPasslist: Boolean(opt.stopovers),
getPolyline: Boolean(opt.polylines),
getTariff: Boolean(opt.tickets),
};
if (profile.refreshJourneyUseOutReconL) {
req.outReconL = [{ctx: refreshToken}];
} else {
req.ctxRecon = refreshToken;
}
return {
meth: 'Reconstruction',
req,
};
};
export {
formatRefreshJourneyReq,
};