Clarify logs for pirep cancel/updates

This commit is contained in:
Nabeel Shahzad
2021-12-07 13:24:18 -05:00
parent a3f110c0c0
commit 3c9d419ebb
2 changed files with 10 additions and 4 deletions

View File

@@ -148,10 +148,10 @@ class AcarsController extends Controller
$pirep = Pirep::find($id);
$this->checkCancelled($pirep);
Log::debug(
/*Log::debug(
'Posting ACARS update (user: '.Auth::user()->ident.', pirep id :'.$id.'): ',
$request->post()
);
);*/
$count = 0;
$positions = $request->post('positions');
@@ -223,7 +223,7 @@ class AcarsController extends Controller
$pirep = Pirep::find($id);
$this->checkCancelled($pirep);
Log::debug('Posting ACARS log, PIREP: '.$id, $request->post());
// Log::debug('Posting ACARS log, PIREP: '.$id, $request->post());
$count = 0;
$logs = $request->post('logs');

View File

@@ -25,6 +25,7 @@ use App\Models\Pirep;
use App\Models\PirepComment;
use App\Models\PirepFare;
use App\Models\PirepFieldValue;
use App\Models\User;
use App\Repositories\JournalRepository;
use App\Repositories\PirepRepository;
use App\Services\Finance\PirepFinanceService;
@@ -235,8 +236,12 @@ class PirepController extends Controller
Log::info('PIREP Update, user '.Auth::id());
Log::info($request->getContent());
/** @var User $user */
$user = Auth::user();
/** @var Pirep $pirep */
$pirep = Pirep::find($pirep_id);
$this->checkCancelled($pirep);
$attrs = $this->parsePirep($request);
@@ -278,6 +283,7 @@ class PirepController extends Controller
{
Log::info('PIREP file, user '.Auth::id(), $request->post());
/** @var User $user */
$user = Auth::user();
// Check if the status is cancelled...
@@ -332,7 +338,7 @@ class PirepController extends Controller
*/
public function cancel($pirep_id, Request $request)
{
Log::info('PIREP Cancel, user '.Auth::id(), $request->post());
Log::info('PIREP '.$pirep_id.' Cancel, user '.Auth::id(), $request->post());
$pirep = Pirep::find($pirep_id);
$this->pirepSvc->cancel($pirep);