From 45962b27c30caf29dafdf2f8d7bbe2ee270128df Mon Sep 17 00:00:00 2001 From: Ivan Habunek Date: Sun, 19 Nov 2023 14:17:03 +0100 Subject: [PATCH] Fix search sending type=None if not specified --- toot/api.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/toot/api.py b/toot/api.py index 6d2c24e..a3f228c 100644 --- a/toot/api.py +++ b/toot/api.py @@ -452,11 +452,13 @@ def search(app, user, query, resolve=False, type=None): Perform a search. https://docs.joinmastodon.org/methods/search/#v2 """ - return http.get(app, user, "/api/v2/search", { + params = drop_empty_values({ "q": query, - "resolve": resolve, + "resolve": str_bool(resolve), "type": type - }).json() + }) + + return http.get(app, user, "/api/v2/search", params).json() def follow(app, user, account):