feat(strava): add action to create totals and stats report
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import defineAction from '../../../../helpers/define-action';
|
||||
|
||||
export default defineAction({
|
||||
name: 'Create totals and stats report',
|
||||
key: 'createTotalsAndStatsReport',
|
||||
description: 'Create a report with recent, year to date, and all time stats of your activities',
|
||||
|
||||
async run($) {
|
||||
const { data } = await $.http.get(`/v3/athletes/${$.auth.data.athleteId}/stats`);
|
||||
|
||||
$.setActionItem({
|
||||
raw: data,
|
||||
});
|
||||
},
|
||||
});
|
3
packages/backend/src/apps/strava/actions/index.ts
Normal file
3
packages/backend/src/apps/strava/actions/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import createTotalsAndStatsReport from "./create-totals-and-stats-report";
|
||||
|
||||
export default [createTotalsAndStatsReport];
|
@@ -1,5 +1,6 @@
|
||||
import defineApp from '../../helpers/define-app';
|
||||
import addAuthHeader from './common/add-auth-header';
|
||||
import actions from './actions';
|
||||
import auth from './auth';
|
||||
|
||||
export default defineApp({
|
||||
@@ -13,4 +14,5 @@ export default defineApp({
|
||||
primaryColor: 'fc4c01',
|
||||
beforeRequest: [addAuthHeader],
|
||||
auth,
|
||||
actions,
|
||||
});
|
||||
|
Reference in New Issue
Block a user