Change LatestPireps Widget Sort Order (#1099)

* Change LatestPireps Widget Sort Order

Latest pireps should be ordered by `submitted_at` instead of `created_at` . 

Pirep may be created even a day before others (with the pause/resume ability we have in acars) but it gets submitted once when the flight is ended, thus I think it should be our reference to sort them in proper order.

* Trying to Pass UnitTest
pull/1100/head
B.Fatih KOZ 4 years ago committed by GitHub
parent 43c33adcfe
commit c2b0b69eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -8,6 +8,7 @@ use App\Repositories\PirepRepository;
/**
* Show the latest PIREPs in a view
* sorted nicely by their submit time
*/
class LatestPireps extends Widget
{
@ -28,7 +29,7 @@ class LatestPireps extends Widget
PirepState::CANCELLED,
PirepState::DRAFT,
PirepState::IN_PROGRESS,
], 'created_at', 'desc')
], 'submitted_at', 'desc')
->recent($this->config['count']);
return view('widgets.latest_pireps', [

Loading…
Cancel
Save