diff --git a/server/stats.go b/server/stats.go index d55f3af..c8600a5 100644 --- a/server/stats.go +++ b/server/stats.go @@ -205,7 +205,8 @@ func generateStats(ctx context.Context) ([]ChartData, error) { `SELECT date_trunc('day', updated_at) date, status, COUNT(*) AS count FROM tasks WHERE status = $1 OR status = $2 - GROUP BY 1,2;`, constants.TASK_STATUS_SUCCESS, constants.TASK_STATUS_FAILED) + GROUP BY 1,2 + ORDER BY updated_at ;`, constants.TASK_STATUS_SUCCESS, constants.TASK_STATUS_FAILED) if err != nil { return nil, fmt.Errorf("Query Task Status Day: %w", err) }