node-strava/node-strava-v3

Question: Is it possible to update multiple activities with one API request?

bigandy opened this issue · 0 comments

Situation:
I want to update multiple activities with strava.activities.update is it possible or do in one go.

Or would I have to do it once per activity id?

otherwise would this be the best approach?

const selectedActivities = [{id: 1}, {id:2}, {id:3}];

await selectedIds.reduce((promiseChain, currentActivity) => {
    return promiseChain.then(async () => {
        await strava.activities.update({ id: currentActivity.id, name: "has been updated" });
    });
}, Promise.resolve());