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