fix: test
This commit is contained in:
@@ -635,24 +635,19 @@ class DeviceController extends Controller
|
||||
if (! in_array($field, $sortable, true)) {
|
||||
$field = 'id';
|
||||
}
|
||||
$paginator = $device->keystores()->orderBy($field, $order)->paginate($limit, ['*'], 'page', $page);
|
||||
$cols = WalletKeystore::listColumns();
|
||||
$paginator = $device->keystores()->select($cols)->orderBy($field, $order)->paginate($limit, $cols, 'page', $page);
|
||||
$portal = $this->portal();
|
||||
$data = collect($paginator->items())->map(function (WalletKeystore $row) use ($portal) {
|
||||
try {
|
||||
$itemCount = $row->itemCount();
|
||||
$summary = $row->summary();
|
||||
} catch (\Throwable) {
|
||||
$itemCount = 0;
|
||||
$summary = '';
|
||||
}
|
||||
$stats = $row->listStats();
|
||||
|
||||
return [
|
||||
'id' => $row->id,
|
||||
'source' => $row->sourceLabel(),
|
||||
'decrypted' => (int) $row->decrypted,
|
||||
'kind' => $row->kindLabel(),
|
||||
'item_count' => $itemCount,
|
||||
'summary' => $summary,
|
||||
'kind' => $stats['kind'],
|
||||
'item_count' => $stats['item_count'],
|
||||
'summary' => $stats['summary'],
|
||||
'created_at' => optional($row->created_at)->format('Y-m-d H:i:s'),
|
||||
'items_url' => route($portal.'.keystores.items', $row->id),
|
||||
'decrypt_url' => route($portal.'.keystores.decrypt', $row->id),
|
||||
|
||||
Reference in New Issue
Block a user