19 lines
494 B
Python
19 lines
494 B
Python
from flask import request
|
|
|
|
from .blueprint import api_library
|
|
|
|
from ....controller import LibraryController
|
|
from ....schema.library.library import Library
|
|
|
|
import logging
|
|
logger = logging.getLogger(__name__)
|
|
|
|
@api_library.route("/", methods=["POST"])
|
|
def create_library():
|
|
|
|
data = request.json
|
|
|
|
with LibraryController() as controller:
|
|
lib = Library(**data)
|
|
library = controller.create(lib)
|
|
return { "status": "ok", "result": library.data.to_dict() }, 200 |