feat(jotform): add jotform integration

This commit is contained in:
Rıdvan Akca
2024-02-02 16:27:43 +03:00
committed by Ali BARIN
parent 7ace67f906
commit 42f8e635ed
11 changed files with 118 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
const addAuthHeader = ($, requestConfig) => {
if ($.auth.data?.apiKey) {
requestConfig.headers['APIKEY'] = `${$.auth.data.apiKey}`;
}
return requestConfig;
};
export default addAuthHeader;

View File

@@ -0,0 +1,7 @@
const getCurrentUser = async ($) => {
const response = await $.http.get('/user');
const currentUser = response.data.content;
return currentUser;
};
export default getCurrentUser;

View 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;