mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-05-03 00:40:12 -05:00
update: livewire sortBy to trait and add parameter type
This commit is contained in:
@@ -15,6 +15,7 @@ namespace App\Http\Livewire;
|
||||
|
||||
use App\Models\BonTransactions;
|
||||
use App\Models\User;
|
||||
use App\Traits\LivewireSort;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
|
||||
@@ -23,6 +24,7 @@ use Livewire\WithPagination;
|
||||
*/
|
||||
class GiftLogSearch extends Component
|
||||
{
|
||||
use LivewireSort;
|
||||
use WithPagination;
|
||||
|
||||
public string $sender = '';
|
||||
@@ -75,15 +77,4 @@ class GiftLogSearch extends Component
|
||||
'gifts' => $this->gifts,
|
||||
]);
|
||||
}
|
||||
|
||||
final public function sortBy($field): void
|
||||
{
|
||||
if ($this->sortField === $field) {
|
||||
$this->sortDirection = $this->sortDirection === 'asc' ? 'desc' : 'asc';
|
||||
} else {
|
||||
$this->sortDirection = 'asc';
|
||||
}
|
||||
|
||||
$this->sortField = $field;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user