File: D:/HostingSpaces/SBogers10/reiskick.komma.nl/vendor/komma/kms/resources/js/global/configService.js
import { axios } from './axiosBootstrapper'
/**
* ConfigService
*
* Connects to laravel's config() helper
*/
class ConfigService {
constructor()
{
this.baseRoute = '/globalisation/config/';
}
/**
* Returns a promise which resolves into a response with your config data.
*
* @param {string} key
*/
async get(key) {
let result = '';
await axios.post(this.baseRoute+'get', {'key': key}).then((response) => {
result = response.data;
}).catch((error) => {
console.error('Could not get config key: '+key+'. Because of this error: ', error);
});
return result;
}
}
export { ConfigService }