custom_components/bahmcloud_store/custom_repo_view.py gelöscht
This commit is contained in:
@@ -1,28 +0,0 @@
|
|||||||
from __future__ import annotations
|
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
|
||||||
|
|
||||||
from homeassistant.components.http import HomeAssistantView
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from .core import BCSCore
|
|
||||||
|
|
||||||
|
|
||||||
class BCSCustomRepoView(HomeAssistantView):
|
|
||||||
"""
|
|
||||||
DELETE /api/bcs/custom_repo?id=...
|
|
||||||
"""
|
|
||||||
requires_auth = True
|
|
||||||
name = "bcs_custom_repo_api"
|
|
||||||
url = "/api/bcs/custom_repo"
|
|
||||||
|
|
||||||
def __init__(self, core: "BCSCore") -> None:
|
|
||||||
self.core = core
|
|
||||||
|
|
||||||
async def delete(self, request):
|
|
||||||
repo_id = request.query.get("id", "").strip()
|
|
||||||
if not repo_id:
|
|
||||||
return self.json({"error": "id missing"}, status_code=400)
|
|
||||||
|
|
||||||
await self.core.remove_custom_repo(repo_id)
|
|
||||||
return self.json({"ok": True})
|
|
||||||
Reference in New Issue
Block a user