diff --git a/utils/functions.ts b/utils/functions.ts index ff984d7..f5a784c 100644 --- a/utils/functions.ts +++ b/utils/functions.ts @@ -30,9 +30,10 @@ export function getObjectByCadastralId( id: string | number, fallbackItem?: object ) { - return fetch( - `https://dev.qgis.biip.lt/qgisserver/uetk_zuvinimas?SERVICE=WFS&REQUEST=GetFeature&TYPENAME=uetk_zuvinimas_info&OUTPUTFORMAT=application/json&FILTER=%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ecadastral_id%3C/PropertyName%3E%3CLiteral%3E${id}%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E` - ) + const host = process.env.QGIS_SERVER_HOST || 'https://gis.biip.lt'; + const url = `${host}/qgisserver/uetk_zuvinimas?SERVICE=WFS&REQUEST=GetFeature&TYPENAME=uetk_zuvinimas_info&OUTPUTFORMAT=application/json&FILTER=%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Ecadastral_id%3C/PropertyName%3E%3CLiteral%3E${id}%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E`; + + return fetch(url) .then((r) => r.json()) .then((r) => r.features) .then((r) => {