1차 수정

This commit is contained in:
2023-04-27 23:22:03 +09:00
parent 97a9ad6c72
commit 2f563e4324
2 changed files with 51 additions and 58 deletions

View File

@ -58,8 +58,11 @@ async def add_widget(request):
widget_id: 추가할 위젯 ID
"""
widget_id = request.match_info['widget_id']
await toonat.add_widget_id_and_start_fetching(widget_id)
return web.Response(text=f"Widget ID {widget_id} added and fetching started.")
result = await toonat.add_widget_id_and_start_fetching(widget_id)
if result:
return web.Response(text=f"Widget ID {widget_id} added and fetching started.")
else:
return web.Response(text=f"Widget ID {widget_id} already exists in the list.")
@routes.get('/remove_widget/{widget_id}')
async def remove_widget(request):