File tree Expand file tree Collapse file tree
src/app/api/latest/emails/outbox Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -704,11 +704,6 @@ enum EmailOutboxCreatedWith {
704704 PROGRAMMATIC_CALL
705705}
706706
707- // In most displays, the way emails in the outbox should be ordered is:
708- // - by finishedSendingAt, descending (null comes first)
709- // - by scheduledAtIfNotYetQueued, descending (null comes last)
710- // - by priority, ascending
711- // - by id, ascending
712707model EmailOutbox {
713708 tenancyId String @db.Uuid
714709
Original file line number Diff line number Diff line change @@ -317,11 +317,7 @@ export const emailOutboxCrudHandlers = createLazyProxy(() => createCrudHandlers(
317317 const emails = await globalPrismaClient . emailOutbox . findMany ( {
318318 where,
319319 orderBy : [
320- // Emails with finishedSendingAt come first (most recent first), then nulls
321- { finishedSendingAt : { sort : "desc" , nulls : "last" } } ,
322- // For not-yet-sent emails: scheduled ones come first (most recent first), then nulls
323- { scheduledAtIfNotYetQueued : { sort : "desc" , nulls : "last" } } ,
324- { priority : "asc" } ,
320+ { createdAt : "desc" } ,
325321 { id : "asc" } ,
326322 ] ,
327323 // +1 to check if there's a next page
You can’t perform that action at this time.
0 commit comments