Merge pull request #4570 from artoscinote/ma_SCI_7357

Only render last label in ZPL [SCI-7357]
This commit is contained in:
artoscinote 2022-10-25 11:53:52 +02:00 committed by GitHub
commit eec5fd9ab3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -130,7 +130,9 @@ class LabelTemplatesController < ApplicationController
def zpl_preview
service = LabelTemplatesPreviewService.new(params, current_user)
payload = service.generate_zpl_preview!
# only render last generated label image
payload = service.generate_zpl_preview!.split.last
if service.error.blank?
render json: { base64_preview: payload }