From e6818a527a3b006c581a2d4a7722b77c1cb1ba58 Mon Sep 17 00:00:00 2001 From: WhyAsh5114 Date: Sat, 2 Nov 2024 01:59:11 +0530 Subject: [PATCH] fix: add orderBy clause for exerciseIndex in new workouts --- src/lib/trpc/routes/workouts.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/trpc/routes/workouts.ts b/src/lib/trpc/routes/workouts.ts index ee09dad8..86d30f02 100644 --- a/src/lib/trpc/routes/workouts.ts +++ b/src/lib/trpc/routes/workouts.ts @@ -50,7 +50,7 @@ const createActiveMesocycleWithProgressionDataInclude = (splitDayIndex?: number) return Prisma.validator()({ mesocycleExerciseSplitDays: { - include: { mesocycleSplitDayExercises: true }, + include: { mesocycleSplitDayExercises: { orderBy: { exerciseIndex: 'asc' } } }, orderBy: { dayIndex: 'asc' } }, mesocycleCyclicSetChanges: true,