feat: add normalized public search filters
Quality / test (push) Canceled after 0s

Add strict public search numeric validation and URL-backed category and price filters to the catalog UI.
This commit is contained in:
2026-09-09 01:32:32 -04:00
parent 7aa8e9eaf2
commit 67ce29a93e
5 changed files with 49 additions and 13 deletions
@@ -32,4 +32,17 @@ test('returns public search results with pagination metadata', async (testContex
totalPages: 2,
});
assert.equal(response.json().data.items[0].id, 'listing-1');
});
test('rejects malformed numeric search filters', async (testContext) => {
const app = buildApp({ searchService: { async searchPublic() { throw new Error('should not run'); } } });
testContext.after(() => app.close());
const response = await app.inject({
method: 'GET',
url: '/api/v1/public/search?minPriceMinor=12.5',
});
assert.equal(response.statusCode, 400);
assert.equal(response.json().error.code, 'INVALID_SEARCH_FILTER');
});