|
@@ -121,25 +121,19 @@ export class WebService {
|
|
|
async searchArticles(key: string, locale?: string) {
|
|
|
const lang = this.sharedService.handleValidLang(locale);
|
|
|
const articles = await this.articleRepo.find({
|
|
|
- where: [
|
|
|
- {
|
|
|
- enable: true,
|
|
|
- },
|
|
|
- {
|
|
|
- translations: {
|
|
|
- locale: lang,
|
|
|
- title: Like(`%${key || ''}%`),
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- translations: {
|
|
|
- locale: lang,
|
|
|
- content: Like(`%${key || ''}%`),
|
|
|
- },
|
|
|
- },
|
|
|
- ],
|
|
|
+ where: {
|
|
|
+ enable: true,
|
|
|
+ translations: [{
|
|
|
+ locale: lang,
|
|
|
+ title: Like(`%${key || ''}%`),
|
|
|
+ },{
|
|
|
+ locale: lang,
|
|
|
+ content: Like(`%${key || ''}%`),
|
|
|
+ }],
|
|
|
+ },
|
|
|
relations: { translations: true },
|
|
|
});
|
|
|
+
|
|
|
return articles.map((article) => article.translate(lang));
|
|
|
}
|
|
|
|