fix(knowledge-base): use LIKE_OPERATOR in the MikroORM article name filter

Merged
CE
7d ago
+69-1

Problem

HelpCenterArticleService.getArticlesByProjectId filters by name with a literal 'ILIKE' in its MikroORM (Knex) arm, while the TypeORM arm already uses LIKE_OPERATOR. Under MikroORM on MySQL and SQLite, filtering articles by name fails with a SQL syntax error.

Fix

LIKE_OPERATOR in the Knex arm too.

Tests

New help-center-article.service.like-operator.spec.ts: with LIKE_OPERATOR resolved to LIKE, the name filter uses LIKE, never ILIKE.

Notes

Not built or run locally.


Summary by cubic

Fixes the MikroORM (Knex) article name filter in getArticlesByProjectId so searching by article name no longer fails on MySQL and SQLite.

The MikroORM arm used a hard-coded 'ILIKE', which only PostgreSQL supports, while the TypeORM arm already used LIKE_OPERATOR. It now uses LIKE_OPERATOR in both arms.

  • Adds a spec that verifies the name filter resolves to LIKE, never ILIKE.