From 98544191efb4f34ad8cf801e61435b026065f4ef Mon Sep 17 00:00:00 2001 From: Kara <49822414+karashiiro@users.noreply.github.com> Date: Thu, 1 Aug 2024 21:11:50 -0700 Subject: [PATCH] Fix multi-condition search queries and mark next as optional (#161) --- service/search.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/search.ts b/service/search.ts index b41ab9c..67abb45 100644 --- a/service/search.ts +++ b/service/search.ts @@ -29,7 +29,7 @@ const BoilmasterItemSearchResult = z.object({ }); const BoilmasterItemSearchResults = z.object({ - next: z.string(), + next: z.string().optional(), results: z.array( BoilmasterSheetRow(BoilmasterItemSearchResult).merge( z.object({ @@ -139,7 +139,7 @@ export async function searchItemsV2( const searchUrl = 'https://beta.xivapi.com/api/1/search'; const params = new URLSearchParams({ sheets: 'Item', - query: `Name~"${query}" ItemSearchCategory>=1`, + query: `+Name~"${query}" +ItemSearchCategory>=1`, language: lang, limit: '30', // LevelItem.todo is a nonexistent field, but using that causes an empty fields