Fetch the latest status of a single train.
Returns null when the response body is nullish (train no longer exists) so callers can distinguish "gone" from "unchanged".
null
FetchUpdatedTrainStatusParams.
Promise resolving to the updated train, or null.
Error when donationTrainApiUrl isn't configured, or when the response is non-2xx.
donationTrainApiUrl
const train = await fetchUpdatedTrainStatus({ trainID: "t-1" }); Copy
const train = await fetchUpdatedTrainStatus({ trainID: "t-1" });
FetchUpdatedTrainStatusParams
Fetch the latest status of a single train.
Returns
nullwhen the response body is nullish (train no longer exists) so callers can distinguish "gone" from "unchanged".