We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents b9c3b5f + 0c56c08 commit 8a69493Copy full SHA for 8a69493
src/api/my-review/myReview.service.ts
@@ -533,10 +533,13 @@ export class MyReviewService {
533
break;
534
}
535
536
- const fallbackOrderFragments = [
537
- Prisma.sql`c."createdAt" DESC NULLS LAST`,
538
- Prisma.sql`c.name ASC`,
539
- ];
+ const fallbackOrderFragments = shouldFetchPastChallenges
+ ? [
+ Prisma.sql`c."endDate" DESC NULLS LAST`,
+ Prisma.sql`c."createdAt" DESC NULLS LAST`,
540
+ Prisma.sql`c.name ASC`,
541
+ ]
542
+ : [Prisma.sql`c."createdAt" DESC NULLS LAST`, Prisma.sql`c.name ASC`];
543
const orderFragments = sortFragments.length
544
? [...sortFragments, ...fallbackOrderFragments]
545
: fallbackOrderFragments;
0 commit comments