return error when thread is not found

This commit is contained in:
agatha 2024-04-01 00:04:04 -04:00
parent 4228107b54
commit 16b468d9ab

View File

@ -85,6 +85,9 @@ async def get_thread(thread_id: int):
if post.thread_id == thread_id: if post.thread_id == thread_id:
result.append(post) result.append(post)
if len(result) == 0:
return {'error': 'could not find parent thread'}
return result return result