[WIP] Library REST API

This commit is contained in:
2026-02-15 11:32:33 +01:00
parent c468f51672
commit c701a4ab9b
8 changed files with 131 additions and 5 deletions

View File

@@ -0,0 +1,23 @@
from flask import request
from sqlalchemy.exc import NoResultFound
from .blueprint import api_library
from ....controller import LibraryController
from ....schema.library.library import Library
import logging
logger = logging.getLogger(__name__)
@api_library.route("/<_id>", methods=["DELETE"])
def delete_library(_id):
try: # TODO: function
controller = LibraryController(_id)
except NoResultFound as e:
logger.debug({e})
return { "status": "error", "error": "Library not found" }, 404
controller.delete()
return { "status": "ok" }, 201