Skip to content

Commit 085586e

Browse files
committed
Fix users pagination state restored on back
1 parent e0c757e commit 085586e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

app/resources/user_resource.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class UserResource < JSONAPI::Resource
22
extend ModelFilter
3-
attributes :email, :confirmed_at
3+
attributes :email, :confirmed_at, :created_at
44

55
paginator :paged
66
model_filters :email_contains

client/src/components/Users/UserList.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const formatDate = date => (new Date(date)).toLocaleString();
99

1010
export class UserList extends Component {
1111
componentWillMount() {
12-
this.props.fetchResourceList();
12+
const { resourceList } = this.props;
13+
this.props.fetchResourceList({ sort: '-createdAt', ...resourceList.params });
1314
}
1415

1516
render() {
@@ -21,8 +22,8 @@ export class UserList extends Component {
2122
sortable: true,
2223
},
2324
{
24-
attribute: 'confirmedAt',
25-
header: 'Confirmed At',
25+
attribute: 'createdAt',
26+
header: 'Created At',
2627
rowRender: user => formatDate(user.confirmedAt),
2728
sortable: true,
2829
},

0 commit comments

Comments
 (0)