From b3b58df2b1e7e49545a48ed31455d9d1b4582354 Mon Sep 17 00:00:00 2001 From: Christof Dorner Date: Wed, 10 May 2023 16:17:00 +0000 Subject: [PATCH] Fix hashtag search results (#576) We mistakenly wrote to the key "hashtag" instead of "hashtags", resulting in no results in the API response. Additionally, the type of the Tag's `history` needs to be a list, not a dict. This fixes hashtag search in Elk. --- api/schemas.py | 2 +- api/views/search.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/api/schemas.py b/api/schemas.py index 7498d64..de0ce0a 100644 --- a/api/schemas.py +++ b/api/schemas.py @@ -275,7 +275,7 @@ class Notification(Schema): class Tag(Schema): name: str url: str - history: dict + history: list following: bool | None @classmethod diff --git a/api/views/search.py b/api/views/search.py index a664af9..a76ef01 100644 --- a/api/views/search.py +++ b/api/views/search.py @@ -39,7 +39,7 @@ def search( for i in search_result["identities"] ] if type is None or type == "hashtag": - result["hashtag"] = [ + result["hashtags"] = [ schemas.Tag.from_hashtag(h) for h in search_result["hashtags"] ] if type is None or type == "statuses":