mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Fixed pagination in audit log table
- the `created_at` key is stored directly under the object we fetch as the last event, rather than a subkey - this meant we weren't checking the date of the last event correctly, which broke pagination
This commit is contained in:
parent
e3e613de1c
commit
3831d8d479
@ -47,12 +47,12 @@ export default class AuditLogEventFetcher extends Resource {
|
||||
// NOTE: assumes data is always ordered by created_at desc
|
||||
const lastEvent = this.data[this.data.length - 1];
|
||||
|
||||
if (!lastEvent?.data?.created_at) {
|
||||
if (!lastEvent?.created_at) {
|
||||
this.hasReachedEnd = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const cursor = moment.utc(lastEvent.data.created_at).format('YYYY-MM-DD HH:mm:ss');
|
||||
const cursor = moment.utc(lastEvent.created_at).format('YYYY-MM-DD HH:mm:ss');
|
||||
|
||||
if (cursor === this.cursor) {
|
||||
this.hasReachedEnd = true;
|
||||
|
Loading…
Reference in New Issue
Block a user