feat(jotform): add jotform integration
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
const addAuthHeader = ($, requestConfig) => {
|
||||
if ($.auth.data?.apiKey) {
|
||||
requestConfig.headers['APIKEY'] = `${$.auth.data.apiKey}`;
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default addAuthHeader;
|
||||
@@ -0,0 +1,7 @@
|
||||
const getCurrentUser = async ($) => {
|
||||
const response = await $.http.get('/user');
|
||||
const currentUser = response.data.content;
|
||||
return currentUser;
|
||||
};
|
||||
|
||||
export default getCurrentUser;
|
||||
11
packages/backend/src/apps/jotform/common/set-base-url.js
Normal file
11
packages/backend/src/apps/jotform/common/set-base-url.js
Normal file
@@ -0,0 +1,11 @@
|
||||
const setBaseUrl = ($, requestConfig) => {
|
||||
if ($.auth.data.instanceUrl) {
|
||||
requestConfig.baseURL = $.auth.data.instanceUrl;
|
||||
} else if ($.app.apiBaseUrl) {
|
||||
requestConfig.baseURL = $.app.apiBaseUrl;
|
||||
}
|
||||
|
||||
return requestConfig;
|
||||
};
|
||||
|
||||
export default setBaseUrl;
|
||||
Reference in New Issue
Block a user