update kontor-api
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
Thomas Peetz
2026-08-25 17:45:03 +02:00
parent 57b942a9ca
commit 652378e7de
25 changed files with 187 additions and 248 deletions
+14 -1
View File
@@ -1,11 +1,13 @@
from typing import List
from fastapi import APIRouter, HTTPException
from fastapi import APIRouter, status, HTTPException
from kontor_model.db.models.media import MediaLofi
from src.db.session import SessionDep
from src.core.log_conf import logger
from kontor_model.schema.media.lofi import MediaLofiResponse, lofi_to_response
from kontor_model.db.repository.media.lofi import delete_medialofi
router = APIRouter()
@@ -40,3 +42,14 @@ def get_lofi(lofi_id: str, db: SessionDep) -> MediaLofiResponse:
raise HTTPException(status_code=404, detail="MediaLofi could not be found")
response = lofi_to_response(lofi)
return response
@router.delete("/lofi/{lofi_id}", status_code=status.HTTP_204_NO_CONTENT)
def delete_lofi(lofi_id: str, db: SessionDep):
"""
Delete MediaFile by given id.
"""
lofi = db.get(MediaLofi, lofi_id)
if not lofi:
raise HTTPException(status_code=404, detail="MediaLofi could not be found")
logger.info("delete MediaLofi: %s", lofi_id)
delete_medialofi(db=db, lofi_id=lofi.id)
+2 -2
View File
@@ -513,7 +513,7 @@ wheels = [
[[package]]
name = "kontor-api"
version = "0.1.0"
version = "0.4.0"
source = { virtual = "." }
dependencies = [
{ name = "asyncpg" },
@@ -570,7 +570,7 @@ requires-dist = [
[[package]]
name = "kontor-model"
version = "0.3.0"
version = "0.4.0"
source = { editable = "../kontor-model" }
dependencies = [
{ name = "msgspec", extra = ["toml", "yaml"] },