Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/test' into backmerge_test_to_dev
Browse files Browse the repository at this point in the history
  • Loading branch information
asanchezr committed Jan 30, 2025
2 parents 8c26406 + d1d708f commit e528f60
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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'");
});
});
});
3 changes: 2 additions & 1 deletion source/frontend/src/hooks/layer-api/layerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export const toCqlFilterValue = (object: Record<string, string>, 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 {
Expand Down

0 comments on commit e528f60

Please sign in to comment.