Skip to content

Commit

Permalink
Fix #165
Browse files Browse the repository at this point in the history
  • Loading branch information
olivierbon committed Jul 6, 2022
1 parent cf89487 commit 02efc2c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Release Notes for Element API

## Unreleased
- Fix an issue where `EVENT_BEFORE_SEND_DATA` wasn't returning data. ([#165](https://github.com/craftcms/element-api/issues/165))

## 3.0.0 - 2022-05-03

### Added
Expand Down
2 changes: 1 addition & 1 deletion src/DataEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ class DataEvent extends Event
/**
* @var Scope The Fractal data associated with the event
*/
public $data;
public Scope $payload;
}
2 changes: 1 addition & 1 deletion src/controllers/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function actionIndex(string $pattern): Response
// Fire a 'beforeSendData' event
if ($this->hasEventHandlers(self::EVENT_BEFORE_SEND_DATA)) {
$this->trigger(self::EVENT_BEFORE_SEND_DATA, new DataEvent([
'data' => $data,
'payload' => $data,
]));
}

Expand Down

0 comments on commit 02efc2c

Please sign in to comment.