Skip to content

Commit 944d723

Browse files
authored
[REF-1174] fix(schedule): Update orderBy clause in workflowScheduleRecord query (refly-ai#2012)
fix(schedule): Update orderBy clause in workflowScheduleRecord query - Modified the orderBy clause in the findMany method to sort by both scheduledAt and pk fields, enhancing the query's sorting logic for better data retrieval.
1 parent a38a791 commit 944d723

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

apps/api/src/modules/schedule/schedule.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ export class ScheduleService {
507507
this.prisma.workflowScheduleRecord.count({ where }),
508508
this.prisma.workflowScheduleRecord.findMany({
509509
where,
510-
orderBy: { scheduledAt: 'desc' },
510+
orderBy: [{ scheduledAt: 'desc' }, { pk: 'desc' }],
511511
skip: (page - 1) * pageSize,
512512
take: pageSize,
513513
}),

0 commit comments

Comments
 (0)