fix(catalog): only route facets to POST when query predicate is present

Preserve backward compatibility by keeping filter-only requests on the
existing GET endpoint. Only route to POST when query is present, matching
the pattern used by queryEntities.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2026-02-26 17:13:47 +01:00
parent 4c4632ce1b
commit 105befbbf0
+3 -3
View File
@@ -479,17 +479,17 @@ export class CatalogClient implements CatalogApi {
request: GetEntityFacetsRequest,
options?: CatalogRequestOptions,
): Promise<GetEntityFacetsResponse> {
const { filter, query, facets } = request;
const { filter = [], query, facets } = request;
// Route to POST endpoint if query predicate is provided
if (query || filter) {
if (query) {
return this.getEntityFacetsByPredicate(request, options);
}
return await this.requestOptional(
await this.apiClient.getEntityFacets(
{
query: { facet: facets },
query: { facet: facets, filter: this.getFilterValue(filter) },
},
options,
),