style: auto format whole project

This commit is contained in:
Ali BARIN
2022-11-05 23:57:33 +01:00
parent e338770e57
commit 475f24f661
199 changed files with 2421 additions and 1839 deletions

View File

@@ -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;
};

View File

@@ -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;