feat(invoice-ninja): Set instance URL as base URL
This commit is contained in:
@@ -0,0 +1,13 @@
|
|||||||
|
import { TBeforeRequest } from '@automatisch/types';
|
||||||
|
|
||||||
|
const setBaseUrl: TBeforeRequest = ($, requestConfig) => {
|
||||||
|
const instanceUrl = $.auth.data.instanceUrl as string;
|
||||||
|
|
||||||
|
if (instanceUrl) {
|
||||||
|
requestConfig.baseURL = instanceUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
return requestConfig;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default setBaseUrl;
|
@@ -1,4 +1,5 @@
|
|||||||
import defineApp from '../../helpers/define-app';
|
import defineApp from '../../helpers/define-app';
|
||||||
|
import setBaseUrl from './common/set-base-url';
|
||||||
import addAuthHeader from './common/add-auth-header';
|
import addAuthHeader from './common/add-auth-header';
|
||||||
import auth from './auth';
|
import auth from './auth';
|
||||||
import triggers from './triggers';
|
import triggers from './triggers';
|
||||||
@@ -13,7 +14,7 @@ export default defineApp({
|
|||||||
authDocUrl: 'https://automatisch.io/docs/apps/invoice-ninja/connection',
|
authDocUrl: 'https://automatisch.io/docs/apps/invoice-ninja/connection',
|
||||||
primaryColor: '000000',
|
primaryColor: '000000',
|
||||||
supportsConnections: true,
|
supportsConnections: true,
|
||||||
beforeRequest: [addAuthHeader],
|
beforeRequest: [setBaseUrl, addAuthHeader],
|
||||||
auth,
|
auth,
|
||||||
triggers,
|
triggers,
|
||||||
actions,
|
actions,
|
||||||
|
Reference in New Issue
Block a user