Skip to content

Commit

Permalink
fixed public search issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Ratatinator97 committed Jun 7, 2024
1 parent efeedcd commit 0e2cd8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/collection/collection.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ export class CollectionRepository extends Repository<Collection> {
try {
query.where('collection.public = :bool', { bool: true });
if (filterDto.search) {
query.andWhere('LOWER(collection.meaning) like LOWER(:search)', {
query.andWhere('LOWER(collection.meaning::text) like LOWER(:search)', {
search: `%${filterDto.search}%`,
});
collections = await query.skip(toSkip).take(toTake).getMany();
Expand All @@ -445,6 +445,7 @@ export class CollectionRepository extends Repository<Collection> {
} else {
collections = await query.getMany();
}
console.log(collections);
return collections;
} catch (err) {
throw new InternalServerErrorException(
Expand Down

0 comments on commit 0e2cd8c

Please sign in to comment.