Skip to content

Commit

Permalink
[skip ci][CRUD] fix import pb with ResponseFormatter
Browse files Browse the repository at this point in the history
Remove Rest response formatter from CRUD
see #173
  • Loading branch information
jcheron committed Mar 13, 2021
1 parent 0f42db7 commit 7f5a861
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Ubiquity/controllers/crud/CRUDController.php
Expand Up @@ -8,7 +8,6 @@
use Ubiquity\controllers\semantic\MessagesTrait;
use Ubiquity\utils\http\URequest;
use Ubiquity\utils\http\UResponse;
use Ubiquity\controllers\rest\ResponseFormatter;
use Ubiquity\orm\OrmUtils;
use Ubiquity\utils\base\UString;
use Ajax\semantic\html\collections\HtmlMessage;
Expand Down Expand Up @@ -106,8 +105,11 @@ public function refresh_() {
if (isset ( $recordsPerPage )) {
if (! is_array ( $grpByFields )) {
UResponse::asJSON ();
$responseFormatter = new ResponseFormatter ();
print_r ( $responseFormatter->getJSONDatas ( $instances ) );
$objects = \array_map ( function ($o) {
return $o->_rest;
}, $instances );

echo \json_encode(\array_values ( $objects ));
} else {
$this->_renderDataTableForRefresh ( $instances, $model, $totalCount );
}
Expand Down

0 comments on commit 7f5a861

Please sign in to comment.