feat(vtiger-crm): add vtiger crm integration
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
const addAuthHeader = ($, requestConfig) => {
|
||||
const { data } = $.auth;
|
||||
|
||||
if (data?.username && data?.accessKey) {
|
||||
requestConfig.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||
requestConfig.auth = {
|
||||
username: data.username,
|
||||
password: data.accessKey,
|
||||
};
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default addAuthHeader;
|
10
packages/backend/src/apps/vtiger-crm/common/set-base-url.js
Normal file
10
packages/backend/src/apps/vtiger-crm/common/set-base-url.js
Normal file
@@ -0,0 +1,10 @@
|
||||
const setBaseUrl = ($, requestConfig) => {
|
||||
const domain = $.auth.data.domain;
|
||||
if (domain) {
|
||||
requestConfig.baseURL = `https://${domain}.vtiger.com`;
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default setBaseUrl;
|
Reference in New Issue
Block a user