mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +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,
|
||
|
};
|