feat(slack): add get-current-user helper
This commit is contained in:
13
packages/backend/src/apps/slack/common/get-current-user.ts
Normal file
13
packages/backend/src/apps/slack/common/get-current-user.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
|
||||
|
||||
const getCurrentUser = async ($: IGlobalVariable): Promise<IJSONObject> => {
|
||||
const params = {
|
||||
user: $.auth.data.userId as string,
|
||||
}
|
||||
const response = await $.http.get('/users.info', { params });
|
||||
const currentUser = response.data.user;
|
||||
|
||||
return currentUser;
|
||||
};
|
||||
|
||||
export default getCurrentUser;
|
Reference in New Issue
Block a user