From 5e1ad97d52d1251372cb4e9e13ec2d85f23da201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Freyd?= Date: Sun, 14 Jan 2018 13:37:10 -0500 Subject: [PATCH] Remove list of events being loaded in the dashboard for no reason (#811) Close #764 --- .gitignore | 1 + app/Http/Controllers/DashboardController.php | 21 -------------------- 2 files changed, 1 insertion(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 88b8f6fc2..c8abca435 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ monica.sublime-workspace .DS_Store npm-debug.log.* /results +.vscode \ No newline at end of file diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php index b260d2af1..0dcd79ec4 100644 --- a/app/Http/Controllers/DashboardController.php +++ b/app/Http/Controllers/DashboardController.php @@ -4,9 +4,7 @@ namespace App\Http\Controllers; use Auth; use App\Debt; -use App\Event; use App\Contact; -use App\Helpers\DateHelper; use Illuminate\Http\Request; class DashboardController extends Controller @@ -56,26 +54,7 @@ class DashboardController extends Controller return $totalOwedDebt + $debt->amount; }, 0); - // List of events - $events = $account->events()->limit(30)->get() - ->reject(function (Event $event) { - return $event->contact === null; - }) - ->map(function (Event $event) use ($account) { - return [ - 'id' => $event->id, - 'date' => DateHelper::createDateFromFormat($event->created_at, auth()->user()->timezone), - 'object' => $object ?? null, - 'contact_id' => $event->contact->id, - 'object_type' => $event->object_type, - 'object_id' => $event->object_id, - 'contact_complete_name' => $event->contact->getCompleteName(auth()->user()->name_order), - 'nature_of_operation' => $event->nature_of_operation, - ]; - }); - $data = [ - 'events' => $events, 'lastUpdatedContacts' => $lastUpdatedContactsCollection, 'number_of_contacts' => $account->contacts_count, 'number_of_reminders' => $account->reminders_count,