fix core middleware and make search case insensitive
This commit is contained in:
parent
7ec4324fde
commit
760c91af56
3 changed files with 19 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import { AbstractRepository } from "./AbstractRepository.js";
|
||||
import { RecipeEntity } from "../entities/RecipeEntity.js";
|
||||
import { AppDataSource } from "../data-source.js";
|
||||
import { Like } from "typeorm";
|
||||
import { ILike, Like } from "typeorm";
|
||||
|
||||
export class RecipeRepository extends AbstractRepository<RecipeEntity> {
|
||||
constructor() {
|
||||
|
|
@ -32,7 +32,7 @@ export class RecipeRepository extends AbstractRepository<RecipeEntity> {
|
|||
async findCompactRecipeBySearch(searchString : string): Promise<RecipeEntity[] | null>{
|
||||
// @todo doesn't work like expected...
|
||||
return this.repo.find(
|
||||
{ where: {title: Like(`%${searchString}%`)}}
|
||||
{ where: {title: ILike(`%${searchString}%`)}}
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue