Skip to content

Commit

Permalink
feat: allow search with tutories name
Browse files Browse the repository at this point in the history
  • Loading branch information
Veirt committed Dec 2, 2024
1 parent 70d9721 commit 1409640
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/module/tutories/tutories.repository.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
import { db as dbType } from "@/db/config";
import { orders, categories, tutories, tutors } from "@/db/schema";
import { categories, orders, tutories, tutors } from "@/db/schema";
import {
createTutoriesSchema,
updateTutoriesSchema,
} from "@/module/tutories/tutories.schema";
import { DayIndex, GetTutoriesFilters } from "@/types";
import {
and,
avg,
eq,
gte,
ilike,
inArray,
lte,
not,
or,
} from "drizzle-orm";
import { and, avg, eq, gte, ilike, inArray, lte, not, or } from "drizzle-orm";
import { z } from "zod";

export class TutoriesRepository {
Expand Down Expand Up @@ -65,6 +55,7 @@ export class TutoriesRepository {
if (filters.q) {
conditions.push(
or(
ilike(tutories.name, `%${filters.q}%`),
ilike(tutors.name, `%${filters.q}%`),
ilike(categories.name, `%${filters.q}%`),
),
Expand Down

0 comments on commit 1409640

Please sign in to comment.