Fetch every donation train for a campaign.
The service response is enveloped as { data: DonationTrain[] } — this fetcher unwraps and returns the naked array (or [] if the envelope is malformed).
{ data: DonationTrain[] }
[]
FetchDonationTrainsParams.
Promise resolving to the campaign's donation trains.
Error when donationTrainApiUrl isn't configured, or when the response is non-2xx.
donationTrainApiUrl
const trains = await fetchDonationTrains({ campaignID: "abc", allowEnded: false }); Copy
const trains = await fetchDonationTrains({ campaignID: "abc", allowEnded: false });
FetchDonationTrainsParams
Fetch every donation train for a campaign.
The service response is enveloped as
{ data: DonationTrain[] }— this fetcher unwraps and returns the naked array (or[]if the envelope is malformed).