From d4c953de9807d69273cbbffbba3702d579fcd80d Mon Sep 17 00:00:00 2001 From: qwertyforce <44163887+qwertyforce@users.noreply.github.com> Date: Sun, 13 Sep 2020 18:35:14 +0300 Subject: [PATCH] trim search query --- pages/search.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/search.tsx b/pages/search.tsx index 009f83a..01f6322 100644 --- a/pages/search.tsx +++ b/pages/search.tsx @@ -39,7 +39,7 @@ export default function Search(props:any){ // eslint-disable-next-line @typescript-eslint/no-explicit-any export async function getServerSideProps(context: any) { if (context.query.q) { - const tags = context.query.q.split(',') + const tags = (context.query.q.split(',')).map((tag:string)=>tag.trim()) const images = await db_ops.image_ops.find_images_by_tags(tags) const images_on_page = 30 const photos = []