style: auto format whole project
This commit is contained in:
@@ -3,9 +3,9 @@ import { TBeforeRequest } from '@automatisch/types';
|
||||
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
||||
const authData = $.auth.data;
|
||||
if (
|
||||
requestConfig.headers
|
||||
&& authData?.userAccessToken
|
||||
&& authData?.botAccessToken
|
||||
requestConfig.headers &&
|
||||
authData?.userAccessToken &&
|
||||
authData?.botAccessToken
|
||||
) {
|
||||
if (requestConfig.additionalProperties?.sendAsBot) {
|
||||
requestConfig.headers.Authorization = `Bearer ${authData.botAccessToken}`;
|
||||
@@ -14,7 +14,8 @@ const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
||||
}
|
||||
}
|
||||
|
||||
requestConfig.headers['Content-Type'] = requestConfig.headers['Content-Type'] || 'application/json; charset=utf-8';
|
||||
requestConfig.headers['Content-Type'] =
|
||||
requestConfig.headers['Content-Type'] || 'application/json; charset=utf-8';
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
@@ -3,7 +3,7 @@ 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;
|
||||
|
||||
|
Reference in New Issue
Block a user