feat(strava): add current user utility function
This commit is contained in:
10
packages/backend/src/apps/strava/common/get-current-user.ts
Normal file
10
packages/backend/src/apps/strava/common/get-current-user.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
|
||||||
|
|
||||||
|
const getCurrentUser = async ($: IGlobalVariable): Promise<IJSONObject> => {
|
||||||
|
const response = await $.http.get('/v3/athlete');
|
||||||
|
const currentUser = response.data;
|
||||||
|
|
||||||
|
return currentUser;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default getCurrentUser;
|
Reference in New Issue
Block a user