From 9e451f1155391b16c1828717689fb534fa1ca915 Mon Sep 17 00:00:00 2001 From: Stefan Froemken Date: Tue, 5 Nov 2024 14:12:41 +0100 Subject: [PATCH] Add payload to ImportConfiguration --- Classes/Configuration/ImportConfiguration.php | 5 +++-- Classes/Reaction/ImportEventsReaction.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Classes/Configuration/ImportConfiguration.php b/Classes/Configuration/ImportConfiguration.php index 695406fd..bdfc41ba 100644 --- a/Classes/Configuration/ImportConfiguration.php +++ b/Classes/Configuration/ImportConfiguration.php @@ -24,10 +24,11 @@ class ImportConfiguration private string $storageFolder; - public function __construct(ReactionInstruction $reactionInstruction) + public function __construct(array $payload, ReactionInstruction $reactionInstruction) { $reactionRecord = $reactionInstruction->toArray(); - $this->payload = $reactionRecord['payload'] ?? []; + + $this->payload = $payload; $this->storagePid = (int)($reactionRecord['storage_pid'] ?? 0); $this->storageFolder = $reactionRecord['storage_folder'] ?? ''; } diff --git a/Classes/Reaction/ImportEventsReaction.php b/Classes/Reaction/ImportEventsReaction.php index 77158698..d0e4a2f1 100644 --- a/Classes/Reaction/ImportEventsReaction.php +++ b/Classes/Reaction/ImportEventsReaction.php @@ -49,7 +49,7 @@ public static function getIconIdentifier(): string public function react(ServerRequestInterface $request, array $payload, ReactionInstruction $reaction): ResponseInterface { $statusData = []; - $statusData['success'] = $this->jsonImporter->import(new ImportConfiguration($reaction)); + $statusData['success'] = $this->jsonImporter->import(new ImportConfiguration($payload, $reaction)); if ($statusData['success'] === false) { $statusData['error'] = 'Error while importing events';