mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-12-21 01:30:20 +02:00
30 lines
669 B
JavaScript
30 lines
669 B
JavaScript
|
|
const formatJourneysReq = (ctx, query) => {
|
||
|
|
query = Object.assign(query, ctx.profile.formatTravellers(ctx));
|
||
|
|
return {
|
||
|
|
endpoint: ctx.profile.journeysEndpoint,
|
||
|
|
body: query,
|
||
|
|
method: 'post',
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
const formatRefreshJourneyReq = (ctx, refreshToken) => {
|
||
|
|
const {profile} = ctx;
|
||
|
|
let query = {
|
||
|
|
ctxRecon: refreshToken,
|
||
|
|
deutschlandTicketVorhanden: false,
|
||
|
|
nurDeutschlandTicketVerbindungen: false,
|
||
|
|
reservierungsKontingenteVorhanden: false,
|
||
|
|
};
|
||
|
|
query = Object.assign(query, profile.formatTravellers(ctx));
|
||
|
|
return {
|
||
|
|
endpoint: profile.refreshJourneysEndpoint,
|
||
|
|
body: query,
|
||
|
|
method: 'post',
|
||
|
|
};
|
||
|
|
};
|
||
|
|
|
||
|
|
export {
|
||
|
|
formatJourneysReq,
|
||
|
|
formatRefreshJourneyReq,
|
||
|
|
};
|