Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/api/my-review/myReview.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -533,10 +533,13 @@ export class MyReviewService {
break;
}

const fallbackOrderFragments = [
Prisma.sql`c."createdAt" DESC NULLS LAST`,
Prisma.sql`c.name ASC`,
];
const fallbackOrderFragments = shouldFetchPastChallenges
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[⚠️ correctness]
The change introduces a conditional assignment to fallbackOrderFragments based on shouldFetchPastChallenges. Ensure that shouldFetchPastChallenges is correctly determined earlier in the code to avoid unexpected ordering behavior.

? [
Prisma.sql`c."endDate" DESC NULLS LAST`,
Prisma.sql`c."createdAt" DESC NULLS LAST`,
Prisma.sql`c.name ASC`,
]
: [Prisma.sql`c."createdAt" DESC NULLS LAST`, Prisma.sql`c.name ASC`];
const orderFragments = sortFragments.length
? [...sortFragments, ...fallbackOrderFragments]
: fallbackOrderFragments;
Expand Down