From 91643ceac135addf3a241f79cd51a3f66ac1eeb7 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Thu, 30 May 2024 23:54:18 +0200 Subject: [PATCH] Allowing partial and case-insensitive results from entity and actor search. --- components/alerts/create.vue | 2 +- src/entities.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/alerts/create.vue b/components/alerts/create.vue index e4b6a46..4d875ac 100644 --- a/components/alerts/create.vue +++ b/components/alerts/create.vue @@ -439,7 +439,7 @@ async function createAlert() { async function searchActors() { const res = await get('/actors', { - q: actorQuery.value, + q: `${actorQuery.value}*`, // return partial matches limit: 10, }); diff --git a/src/entities.js b/src/entities.js index bd7039b..3a2b7fb 100644 --- a/src/entities.js +++ b/src/entities.js @@ -29,8 +29,8 @@ export async function fetchEntities(options) { if (options.query) { builder.where((whereBuilder) => { whereBuilder - .whereLike('name', options.query) - .orWhereLike('slug', options.query); + .whereILike('name', `%${options.query}%`) + .orWhereILike('slug', `%${options.query}%`); }); }