2025-02-07 12:55:08 +01:00
|
|
|
import {formatTripReq as hafasFormatTripReq} from '../dbnav/trip-req.js';
|
|
|
|
import {formatTripReq as risTripReq} from '../dbregioguide/trip-req.js';
|
2025-01-14 19:48:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
const formatTripReq = ({profile, opt}, id) => {
|
2025-02-07 12:55:08 +01:00
|
|
|
const _profile = {...profile};
|
2025-01-14 19:48:14 +00:00
|
|
|
if (id.includes('#')) {
|
2025-02-07 12:55:08 +01:00
|
|
|
_profile['tripEndpoint'] = profile.tripEndpoint_dbnav;
|
|
|
|
return hafasFormatTripReq({profile: _profile, opt}, id);
|
2025-01-14 19:48:14 +00:00
|
|
|
}
|
2025-02-07 12:55:08 +01:00
|
|
|
|
|
|
|
_profile['tripEndpoint'] = profile.tripEndpoint_dbregioguide;
|
|
|
|
return risTripReq({profile: _profile, opt}, id);
|
2025-01-14 19:48:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export {
|
|
|
|
formatTripReq,
|
|
|
|
};
|