feat: Convert all app files to JS
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
import { TBeforeRequest } from '@automatisch/types';
|
||||
|
||||
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
||||
const addAuthHeader = ($, requestConfig) => {
|
||||
const { instanceUrl, tokenType, accessToken } = $.auth.data;
|
||||
|
||||
if (instanceUrl) {
|
||||
requestConfig.baseURL = instanceUrl as string;
|
||||
requestConfig.baseURL = instanceUrl;
|
||||
}
|
||||
|
||||
if (tokenType && accessToken) {
|
||||
3
packages/backend/src/apps/zendesk/common/auth-scope.js
Normal file
3
packages/backend/src/apps/zendesk/common/auth-scope.js
Normal file
@@ -0,0 +1,3 @@
|
||||
const authScope = ['read', 'write'];
|
||||
|
||||
export default authScope;
|
||||
@@ -1,3 +0,0 @@
|
||||
const authScope: string[] = ['read', 'write'];
|
||||
|
||||
export default authScope;
|
||||
@@ -1,6 +1,4 @@
|
||||
import { IGlobalVariable, IJSONObject } from '@automatisch/types';
|
||||
|
||||
const getCurrentUser = async ($: IGlobalVariable): Promise<IJSONObject> => {
|
||||
const getCurrentUser = async ($) => {
|
||||
const response = await $.http.get('/api/v2/users/me');
|
||||
const currentUser = response.data.user;
|
||||
|
||||
Reference in New Issue
Block a user