Update sort order for monitorStatusTimelines

This commit is contained in:
Simon Larsen 2024-03-31 13:44:31 +01:00
parent ac0bafe560
commit 899649d55e
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE

View File

@ -755,7 +755,7 @@ export default class StatusPageAPI extends BaseAPI<
} as any,
},
sort: {
createdAt: SortOrder.Descending,
createdAt: SortOrder.Ascending,
},
skip: 0,
limit: LIMIT_INFINITY, // This can be optimized.
@ -764,8 +764,7 @@ export default class StatusPageAPI extends BaseAPI<
},
});
monitorStatusTimelines =
monitorStatusTimelines.reverse();
monitorStatusTimelines = monitorStatusTimelines.concat(
await MonitorStatusTimelineService.findBy({
@ -786,7 +785,7 @@ export default class StatusPageAPI extends BaseAPI<
} as any,
},
sort: {
createdAt: SortOrder.Descending,
createdAt: SortOrder.Ascending,
},
skip: 0,
limit: LIMIT_INFINITY, // This can be optimized.
@ -795,9 +794,6 @@ export default class StatusPageAPI extends BaseAPI<
},
})
);
monitorStatusTimelines =
monitorStatusTimelines.reverse();
}
// check if status page has active incident.