Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Change player->lastPlayDate order filter & apply it to admin
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeKESTEMAN committed Aug 11, 2022
1 parent 307f1f4 commit 28d4c99
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion admin/src/components/player/List.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const List: FunctionComponent<Props> = ({players}) => {
];

return (
<ListGuesser rowClick="show" filters={postFilters} {...players}>
<ListGuesser {...players} rowClick="show" filters={postFilters} sort={{field: 'lastPlayDate', order: 'DESC'}}>
<FieldGuesser source="name"/>
<FieldGuesser source="username"/>
<DateField source="lastPlayDate"
Expand Down
2 changes: 1 addition & 1 deletion api/src/Entity/Player.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
)]
#[ApiFilter(SearchFilter::class, properties: ['username' => 'ipartial', 'name' => 'ipartial'])]
#[ApiFilter(ExistsFilter::class, properties: ['lastPlayDate'])]
#[ApiFilter(OrderFilter::class, properties: ['name', 'username', 'lastPlayDate' => ['nulls_comparison' => OrderFilterInterface::NULLS_SMALLEST, 'default_direction' => 'ASC']])]
#[ApiFilter(OrderFilter::class, properties: ['lastPlayDate' => ['nulls_comparison' => OrderFilterInterface::NULLS_ALWAYS_LAST, 'default_direction' => 'DESC'], 'name', 'username'])]
class Player
{
#[ORM\Id]
Expand Down

0 comments on commit 28d4c99

Please sign in to comment.