don't error when a channel doesn't have any community posts

pull/4413/head
ChunkyProgrammer 2024-01-29 22:20:41 -05:00
rodzic 99a5e9cbc4
commit bce79ca2ee
1 zmienionych plików z 11 dodań i 0 usunięć

Wyświetl plik

@ -57,6 +57,17 @@ def extract_channel_community(items, *, ucid, locale, format, thin_mode, is_sing
.try &.as_s || ""
if error_message == "This channel does not exist."
raise NotFoundException.new(error_message)
elsif error_message == "This channel hasn't posted yet"
response = JSON.build do |json|
json.object do
json.field "authorId", ucid
json.field "comments" do
json.array do
end
end
end
end
return response
else
raise InfoException.new(error_message)
end