fix channel search 404 error response

This commit is contained in:
Simon 2026-05-13 22:43:50 +07:00
parent 2e78ca2393
commit c360a50cc8
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 6 additions and 0 deletions

View File

@ -278,6 +278,12 @@ class ChannelApiSearchView(ApiBaseView):
return Response(error.data, status=400)
self.get_document(parsed["url"])
if not self.response:
error = ErrorResponseSerializer(
{"error": f"channel not found: {query}"}
)
return Response(error.data, status=404)
serializer = ChannelSerializer(self.response)
return Response(serializer.data, status=self.status_code)