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