File: D:/HostingSpaces/SBogers10/base.komma.pro/vendor/komma/kms/resources/js/global/regionInfoService.js
import { axios } from './axiosBootstrapper'
/**
* RegionInfo Service
*/
class RegionInfoService {
constructor()
{
this.baseRoute = '/globalisation/region_info/';
}
/**
* Returns a promise which resolves into an object containing region info or null if it could not be retrieved
*/
async specific() {
let result = null;
await axios.get(this.baseRoute+'specific').then((response) => {
result = response.data;
}).catch((error) => {
console.error('Could not get specific regionInfo. Because of this error: ', error);
});
return result;
}
/**
* Returns a promise which resolves into an object containing region info or null if it could not be retrieved
*/
async neutral() {
let result = null;
await axios.get(this.baseRoute+'neutral').then((response) => {
result = response.data;
}).catch((error) => {
console.error('Could not get neutral regionInfo. Because of this error: ', error);
});
return result;
}
}
export { RegionInfoService }