From debc3ea87265d737721c8355fc36d67b32b3871a Mon Sep 17 00:00:00 2001 From: Shmavon Gazanchyan Date: Sat, 15 Jun 2024 22:18:11 +0100 Subject: [PATCH] Fix the bug with value parameter being overriden by newly introduced q --- src/ZoteroAdapter.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ZoteroAdapter.ts b/src/ZoteroAdapter.ts index e22d4f5..73d57a2 100644 --- a/src/ZoteroAdapter.ts +++ b/src/ZoteroAdapter.ts @@ -4,7 +4,6 @@ import { ZoteroItem } from './ZoteroItem'; import { ZoteroBridgeConnectionType } from './ZoteroBridgeSettings' type ZoteroItemsRequestParameters = { - condition?: string, // ZotServer-specific parameter, to be deprecated in future itemType?: string, tag?: string, format?: string, @@ -77,7 +76,6 @@ export class ZotServerAdapter implements ZoteroAdapter { search(query: string) { return this.items({ - condition: 'quicksearch-titleCreatorYear', q: query }) } @@ -87,7 +85,10 @@ export class ZotServerAdapter implements ZoteroAdapter { url: `${this.baseUrl}/search`, method: 'post', contentType: 'application/json', - body: JSON.stringify(parameters) + body: JSON.stringify({ + condition: 'quicksearch-titleCreatorYear', + value: parameters.q + }) }) .then(JSON.parse) .then((items: any[]) => items.filter(item => !['attachment', 'note'].includes(item.itemType)).map(item => new ZoteroItem(item)))