mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
29 lines
669 B
JavaScript
29 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,
|
|
};
|