From 83f28625ddeeaec8dbd6cd075a132a11a8884577 Mon Sep 17 00:00:00 2001 From: Yuri Yaryshev Date: Tue, 10 Nov 2026 22:59:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=B1=D0=BE=D1=80=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=20=D0=BF=D0=BE=D0=B4=D1=80=D1=8F=D0=B4=D1=87?= =?UTF-8?q?=D0=B8=D0=BA=D0=B0:=20=D1=81=D0=BE=D0=B2=D0=BF=D0=B0=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=20=D0=BD=D0=B0=D1=87?= =?UTF-8?q?=D0=B0=D0=BB=D1=83=20=D1=81=D0=BB=D0=BE=D0=B2=D0=B0=20(wall=20?= =?UTF-8?q?=D0=BD=D0=B5=20=D0=BD=D0=B0=D1=85=D0=BE=D0=B4=D0=B8=D1=82=20Dry?= =?UTF-8?q?wall)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- packages/khbuild_assistant_prep/src/mail/resolve.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/khbuild_assistant_prep/src/mail/resolve.ts b/packages/khbuild_assistant_prep/src/mail/resolve.ts index a00b0c0..5565168 100644 --- a/packages/khbuild_assistant_prep/src/mail/resolve.ts +++ b/packages/khbuild_assistant_prep/src/mail/resolve.ts @@ -138,12 +138,12 @@ export function pgResolveStore(db: Queryable): ResolveStore { return rows.map((r) => ({ jobId: String(r.job_id), name: String(r.name) })); }, async vendorAssignments(jobId, terms) { - const like = terms.map((t) => `%${t.replace(/[%_\\]/g, "")}%`); + const like = terms.map((t) => `\\m${t.replace(/[^a-z0-9а-яё]/g, "")}`); // начало слова: "wall" не находит "Drywall" const { rows } = await db.query( `select t.id as task_id, t.name as task_name, a.membership_id from jt_task t join jt_task_assignment a on a.task_id = t.id join jt_membership m on m.id = a.membership_id and m.role = 'Vendor' where t.job_id = $1 and not t.is_deleted and not t.is_todo and not t.is_group and coalesce(t.progress, 0) < 1 - and ($2::text[] = '{}' or t.name ilike any($2::text[])) + and ($2::text[] = '{}' or t.name ~* any($2::text[])) order by t.start_date nulls last, t.name`, [jobId, like], );