Files
automatisch/packages/backend/src/apps/gitlab/common/get-current-user.ts
Krzysztof Dukszta-Kwiatkowski 6e80ff4eb6 post review fixes
2023-05-30 15:21:13 +02:00

12 lines
363 B
TypeScript

import { IGlobalVariable, IJSONObject } from '@automatisch/types';
const getCurrentUser = async ($: IGlobalVariable): Promise<IJSONObject> => {
// ref: https://docs.gitlab.com/ee/api/users.html#list-current-user
const response = await $.http.get('/api/v4/user');
const currentUser = response.data;
return currentUser;
};
export default getCurrentUser;