ebanutsya

This commit is contained in:
2023-10-28 08:07:53 +03:00
parent 1d2ee676ff
commit 4d98d631f7
6 changed files with 63 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
from routes.auth import auth_blueprint
from routes.orders import orders_blueprint
from routes.barcode import barcode_blueprint
from routes.printing import printing_blueprint

17
routes/printing.py Normal file
View File

@@ -0,0 +1,17 @@
from flask import Blueprint, request, send_file
from routes.utils import jwt_protect_blueprint
import sipro.api.printing
printing_blueprint = jwt_protect_blueprint(Blueprint('printing', __name__))
@printing_blueprint.get('/getLabel')
def get_label():
args = request.args
order_id = args.get('orderId')
data = sipro.api.printing.get_label(order_id)
data.seek(0)
return send_file(data,
as_attachment=True,
download_name='label.pdf',
mimetype='application/pdf')