HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/shop.komma.nl/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 }