Added option to include details in the webhook sent to label printers (#2704)

* Added option to include details in the webhook sent to label printers

* Removed LABEL_PRINTER_INCLUDE_DETAILS flag

* Make this actually work

* Care about all places where webhooks are used / don't forget recipes

---------

Co-authored-by: Bernd Bestel <bernd@berrnd.de>
This commit is contained in:
Fándly Gergő
2025-03-21 17:34:33 +02:00
committed by GitHub
parent 541318e964
commit 89b8a9c1a9
5 changed files with 23 additions and 9 deletions

View File

@@ -69,11 +69,12 @@ class BatteriesApiController extends BaseApiController
{
try
{
$battery = $this->getDatabase()->batteries()->where('id', $args['batteryId'])->fetch();
$batteryDetails = (object)$this->getBatteriesService()->GetBatteryDetails($args['batteryId']);
$webhookData = array_merge([
'battery' => $battery->name,
'battery' => $batteryDetails->battery->name,
'grocycode' => (string)(new Grocycode(Grocycode::BATTERY, $args['batteryId'])),
'details' => $batteryDetails,
], GROCY_LABEL_PRINTER_PARAMS);
if (GROCY_LABEL_PRINTER_RUN_SERVER)