fix: test
This commit is contained in:
@@ -638,13 +638,21 @@ class DeviceController extends Controller
|
||||
$paginator = $device->keystores()->orderBy($field, $order)->paginate($limit, ['*'], '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 = '';
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $row->id,
|
||||
'source' => $row->sourceLabel(),
|
||||
'decrypted' => (int) $row->decrypted,
|
||||
'kind' => $row->kindLabel(),
|
||||
'item_count' => $row->itemCount(),
|
||||
'summary' => $row->summary(),
|
||||
'item_count' => $itemCount,
|
||||
'summary' => $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),
|
||||
|
||||
@@ -137,6 +137,14 @@ class KeystoreController extends Controller
|
||||
*/
|
||||
public function rowPayload(WalletKeystore $row, string $portal): array
|
||||
{
|
||||
try {
|
||||
$itemCount = $row->itemCount();
|
||||
$summary = $row->summary();
|
||||
} catch (\Throwable) {
|
||||
$itemCount = 0;
|
||||
$summary = '';
|
||||
}
|
||||
|
||||
return [
|
||||
'id' => $row->id,
|
||||
'device_key' => $row->device_key ?? $row->device?->device_id ?? '',
|
||||
@@ -144,8 +152,8 @@ class KeystoreController extends Controller
|
||||
'source' => $row->sourceLabel(),
|
||||
'decrypted' => (int) $row->decrypted,
|
||||
'kind' => $row->kindLabel(),
|
||||
'item_count' => $row->itemCount(),
|
||||
'summary' => $row->summary(),
|
||||
'item_count' => $itemCount,
|
||||
'summary' => $summary,
|
||||
'created_at' => optional($row->created_at)->format('Y-m-d H:i:s'),
|
||||
'detail_url' => route($portal.'.devices.show', ['device' => $row->device_id, 'tab' => 'keystores']),
|
||||
'items_url' => route($portal.'.keystores.items', $row->id),
|
||||
|
||||
Reference in New Issue
Block a user