chore: Use get app helper to get application data
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import type { IApp } from '@automatisch/types';
|
||||
import appConfig from '../config/app';
|
||||
|
||||
const appInfoConverter = (rawAppData: string) => {
|
||||
let computedRawData = rawAppData.replace('{BASE_URL}', appConfig.baseUrl);
|
||||
computedRawData = computedRawData.replace('{WEB_APP_URL}', appConfig.webAppUrl);
|
||||
const appInfoConverter = (rawAppData: IApp) => {
|
||||
const stringifiedRawAppData = JSON.stringify(rawAppData);
|
||||
|
||||
const computedJSONData: IApp = JSON.parse(computedRawData)
|
||||
let computedRawData = stringifiedRawAppData.replace(
|
||||
'{BASE_URL}',
|
||||
appConfig.baseUrl
|
||||
);
|
||||
computedRawData = computedRawData.replace(
|
||||
'{WEB_APP_URL}',
|
||||
appConfig.webAppUrl
|
||||
);
|
||||
|
||||
const computedJSONData: IApp = JSON.parse(computedRawData);
|
||||
return computedJSONData;
|
||||
}
|
||||
};
|
||||
|
||||
export default appInfoConverter;
|
||||
|
||||
Reference in New Issue
Block a user