diff --git a/source/frontend/src/components/maps/leaflet/Layers/util.test.tsx b/source/frontend/src/components/maps/leaflet/Layers/util.test.tsx index dc357301ca..012648e7ad 100644 --- a/source/frontend/src/components/maps/leaflet/Layers/util.test.tsx +++ b/source/frontend/src/components/maps/leaflet/Layers/util.test.tsx @@ -205,5 +205,10 @@ describe('mapUtils tests', () => { const cql = toCqlFilterValue({ PID: '12345678', PIN: '54321' }, { forceExactMatch: true }); expect(cql).toBe("PID = '12345678' AND PIN='54321'"); }); + + it('if property id is specified, exact search should always be used', () => { + const cql = toCqlFilterValue({ PROPERTY_ID: '1' }); + expect(cql).toBe("PROPERTY_ID = '1'"); + }); }); }); diff --git a/source/frontend/src/hooks/layer-api/layerUtils.ts b/source/frontend/src/hooks/layer-api/layerUtils.ts index c54a9fa604..c19baaa751 100644 --- a/source/frontend/src/hooks/layer-api/layerUtils.ts +++ b/source/frontend/src/hooks/layer-api/layerUtils.ts @@ -28,7 +28,8 @@ export const toCqlFilterValue = (object: Record, flags?: IWfsCql } else if ( ((key === 'PID' || key === 'PID_PADDED' || key === 'PID_NUMBER') && object[key]?.length === 9) || - flags?.forceExactMatch + flags?.forceExactMatch || + key === 'PROPERTY_ID' ) { cql.push(`${key} = '${object[key]}'`); } else {