feat: add support for multiple label formats in get_label function

This commit is contained in:
2025-05-26 22:43:52 +03:00
parent 39087fc223
commit 6ca3a9372a
2 changed files with 12 additions and 8 deletions

View File

@@ -9,8 +9,8 @@ client = get_client()
router = '/printing'
def get_label(order_product_id: str) -> BytesIO:
method = f'{router}/getLabel?orderId={order_product_id}'
def get_label(order_product_id: str, label_format:str='pdf') -> BytesIO:
method = f'{router}/getLabel?orderId={order_product_id}&format={label_format}'
response: Response = client.method('GET', method, raw=True)
data = BytesIO(response.content)
return data