From 17872a3158757ac5baebb8f376db1eb38353d1cd Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 23 Aug 2023 15:02:32 +1000 Subject: [PATCH] Update docs --- .../Controllers/EmailHistoryController.php | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/app/Http/Controllers/EmailHistoryController.php b/app/Http/Controllers/EmailHistoryController.php index 70d52b28d4..863ac93d6a 100644 --- a/app/Http/Controllers/EmailHistoryController.php +++ b/app/Http/Controllers/EmailHistoryController.php @@ -11,15 +11,11 @@ namespace App\Http\Controllers; -use App\Models\Quote; -use App\Models\Client; -use App\Models\Invoice; -use App\Models\SystemLog; -use App\Models\PurchaseOrder; -use App\Utils\Traits\MakesHash; -use App\Models\RecurringInvoice; use App\Http\Requests\Email\ClientEmailHistoryRequest; use App\Http\Requests\Email\EntityEmailHistoryRequest; +use App\Models\Client; +use App\Models\SystemLog; +use App\Utils\Traits\MakesHash; class EmailHistoryController extends BaseController { @@ -33,17 +29,22 @@ class EmailHistoryController extends BaseController { $data = SystemLog::where('client_id', $client->id) ->where('category_id', SystemLog::CATEGORY_MAIL) - ->orderBy('id','DESC') - ->map(function ($system_log){ - if($system_log->log['history'] ?? false) { - return json_decode($system_log->log['history'], true); - } + ->orderBy('id', 'DESC') + ->map(function ($system_log) { + if($system_log->log['history'] ?? false) { + return json_decode($system_log->log['history'], true); + } }); return response()->json($data, 200); } - + + /** + * May need to expand on this using + * just the message-id and search for the + * entity in the invitations + */ public function entityHistory(EntityEmailHistoryRequest $request) { /** @var \App\Models\User $user */ @@ -62,4 +63,4 @@ class EmailHistoryController extends BaseController return response()->json($data, 200); } -} \ No newline at end of file +}