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:
@@ -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,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user