Skip to content

Commit

Permalink
Add payload to ImportConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
sfroemkenjw committed Nov 5, 2024
1 parent 603b03c commit 9e451f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Classes/Configuration/ImportConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ?? '';
}
Expand Down
2 changes: 1 addition & 1 deletion Classes/Reaction/ImportEventsReaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 9e451f1

Please sign in to comment.