Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ public function call($callable, $vars = [])
// if callable function returns agile data model, then export it
// this is important for REST API implementation
if ($ret instanceof \atk4\data\Model) {
$ret = $ret->export();
if ($ret->only_fields) {
$ret = $ret->export($ret->only_fields); // use only_fields to not add system fields by default
} else {
$ret = $ret->export(); // all fields including allsystem fields
}
}

// no response, just step out
Expand Down