You can now modify webhooks

This commit is contained in:
2023-08-08 02:07:17 +02:00
parent 9ba237a75a
commit 381c16596c
4 changed files with 78 additions and 45 deletions

View File

@ -29,23 +29,3 @@ def get_reader(custom_location: Path | None = None) -> Reader:
db_location: Path = custom_location or Path(data_dir) / "db.sqlite"
return make_reader(url=str(db_location))
def list_webhooks(reader: Reader) -> list[dict[str, str]]:
"""Get current webhooks from the database if they exist otherwise use an empty list.
Args:
reader: The reader to use.
Returns:
list[dict[str, str]]: The webhooks.
"""
webhooks: list[dict[str, str]] = []
# Get global tags
if reader.get_tags(()) is not None:
for tag in reader.get_tag_keys(()):
if tag == "webhooks":
webhooks = reader.get_tag((), "webhooks") # type: ignore
return webhooks