<gh_stars>0
from flask import Blueprint, request
from src.service.service_unit import UnitService

route_unit = Blueprint('unit', __name__)

us = UnitService()


@route_unit.route("/unit", methods=['GET'])
def get_units():
    return us.get_units()

@route_unit.route("/unit", methods=['POST'])
def post_units():
    return us.insert_unit(request.json)

@route_unit.route("/unit/<description>", methods=['GET'])
def get_unit(description):
    return us.get_unit(description)

@route_unit.route("/unit/<description>", methods=['DELETE'])
def delete_unit(description):
    return us.delete_unit(description)

@route_unit.route("/unit/<description>", methods=['UPDATE'])
def update_unit(description):
    return us.update_unit(description)

from flask import Blueprint, request
from src.service.service_unit import UnitService

route_unit = Blueprint('unit', __name__)

us = UnitService()


@route_unit.route("/unit", methods=['GET'])
def get_units():
    return us.get_units()

@route_unit.route("/unit", methods=['POST'])
def post_units():
    return us.insert_unit(request.json)

@route_unit.route("/unit/<description>", methods=['GET'])
def get_unit(description):
    return us.get_unit(description)

@route_unit.route("/unit/<description>", methods=['DELETE'])
def delete_unit(description):
    return us.delete_unit(description)

@route_unit.route("/unit/<description>", methods=['UPDATE'])
def update_unit(description):
    return us.update_unit(description)