1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Update docs

This commit is contained in:
David Bomba 2023-08-23 15:02:32 +10:00
parent 88423df8cb
commit 17872a3158

View File

@ -11,15 +11,11 @@
namespace App\Http\Controllers; 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\ClientEmailHistoryRequest;
use App\Http\Requests\Email\EntityEmailHistoryRequest; use App\Http\Requests\Email\EntityEmailHistoryRequest;
use App\Models\Client;
use App\Models\SystemLog;
use App\Utils\Traits\MakesHash;
class EmailHistoryController extends BaseController class EmailHistoryController extends BaseController
{ {
@ -33,17 +29,22 @@ class EmailHistoryController extends BaseController
{ {
$data = SystemLog::where('client_id', $client->id) $data = SystemLog::where('client_id', $client->id)
->where('category_id', SystemLog::CATEGORY_MAIL) ->where('category_id', SystemLog::CATEGORY_MAIL)
->orderBy('id','DESC') ->orderBy('id', 'DESC')
->map(function ($system_log){ ->map(function ($system_log) {
if($system_log->log['history'] ?? false) { if($system_log->log['history'] ?? false) {
return json_decode($system_log->log['history'], true); return json_decode($system_log->log['history'], true);
} }
}); });
return response()->json($data, 200); 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) public function entityHistory(EntityEmailHistoryRequest $request)
{ {
/** @var \App\Models\User $user */ /** @var \App\Models\User $user */
@ -62,4 +63,4 @@ class EmailHistoryController extends BaseController
return response()->json($data, 200); return response()->json($data, 200);
} }
} }