From 6f5e03da9cc8bd3d105b34e20b24d80bffbbbde7 Mon Sep 17 00:00:00 2001 From: Matt Dunn-Rankin Date: Sun, 31 May 2020 15:52:54 -0700 Subject: [PATCH] trim item search queries --- src/server/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/index.js b/src/server/index.js index 36833eb..b3482d2 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -310,7 +310,7 @@ const resolvers = { return items; }, itemSearch: async (_, { query }, { itemSearchLoader }) => { - const items = await itemSearchLoader.load(query); + const items = await itemSearchLoader.load(query.trim()); return { query, items }; }, itemSearchToFit: async ( @@ -321,7 +321,7 @@ const resolvers = { const petType = await petTypeLoader.load({ speciesId, colorId }); const { bodyId } = petType; const items = await itemSearchToFitLoader.load({ - query, + query: query.trim(), bodyId, offset, limit,