Skip to content

Commit

Permalink
fix(search): don't search for archived goals
Browse files Browse the repository at this point in the history
  • Loading branch information
9teen90nine committed Jul 20, 2023
1 parent 573825f commit 3638d0b
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions trpc/router/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,26 @@ export const search = router({
prisma.goal.findMany({
take: 5,
where: {
OR: [
AND: [
{
title: {
contains: input,
mode: 'insensitive',
},
OR: [
{
title: {
contains: input,
mode: 'insensitive',
},
},
{
description: {
contains: input,
mode: 'insensitive',
},
},
],
},
{
description: {
contains: input,
mode: 'insensitive',
archived: {
not: true,
},
},
],
Expand Down

0 comments on commit 3638d0b

Please sign in to comment.