Replacing icon property when icon has been requested.

Creating <APIButton/> which handles success/failure/pending during API calls.
This commit is contained in:
Roland 2023-07-21 15:14:09 -06:00
parent 237b429cbf
commit 59c4ab2502
No known key found for this signature in database
GPG key ID: 9D6DBD3ACF11AB93
24 changed files with 483 additions and 334 deletions

View file

@ -1,3 +1,4 @@
import asyncio
from http import HTTPStatus
from sanic import response, Blueprint
@ -60,7 +61,7 @@ async def search(_: Request, body: schema.VideoSearchRequest):
@openapi.response(HTTPStatus.NOT_FOUND, JSONErrorResponse)
@wrol_mode_check
@run_after(lib.save_channels_config)
def video_delete(_: Request, video_ids: str):
async def video_delete(_: Request, video_ids: str):
try:
video_ids = [int(i) for i in str(video_ids).split(',')]
except Exception:
@ -69,4 +70,4 @@ def video_delete(_: Request, video_ids: str):
lib.delete_videos(*video_ids)
Events.send_deleted(f'Deleted {len(video_ids)} videos')
return response.raw('', HTTPStatus.NO_CONTENT)
return response.empty()