feat: Convert all app files to JS
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { TBeforeRequest } from '@automatisch/types';
|
||||
import jwt from 'jsonwebtoken';
|
||||
|
||||
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
|
||||
const key = $.auth.data?.apiKey as string;
|
||||
const addAuthHeader = ($, requestConfig) => {
|
||||
const key = $.auth.data?.apiKey;
|
||||
|
||||
if (key) {
|
||||
const [id, secret] = key.split(':');
|
10
packages/backend/src/apps/ghost/common/set-base-url.js
Normal file
10
packages/backend/src/apps/ghost/common/set-base-url.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const setBaseUrl = ($, requestConfig) => {
|
||||
const instanceUrl = $.auth.data.instanceUrl;
|
||||
if (instanceUrl) {
|
||||
requestConfig.baseURL = `${instanceUrl}/ghost/api`;
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default setBaseUrl;
|
@@ -1,12 +0,0 @@
|
||||
import { TBeforeRequest } from '@automatisch/types';
|
||||
|
||||
const setBaseUrl: TBeforeRequest = ($, requestConfig) => {
|
||||
const instanceUrl = $.auth.data.instanceUrl as string;
|
||||
if (instanceUrl) {
|
||||
requestConfig.baseURL = `${instanceUrl}/ghost/api`;
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default setBaseUrl;
|
Reference in New Issue
Block a user