Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update get-program-or-throw.ts

Steven Teyedefbd4a4579
diff --git a/apps/web/lib/api/programs/get-program-or-throw.ts b/apps/web/lib/api/programs/get-program-or-throw.ts
index 6d8f0209a0..cac1313563 100644
--- a/apps/web/lib/api/programs/get-program-or-throw.ts
+++ b/apps/web/lib/api/programs/get-program-or-throw.ts
@@ -21,7 +21,17 @@ export const getProgramOrThrow = async (
id: programId,
workspaceId,
},
- ...(includeDiscounts ? { include: { discounts: true } } : {}),
+ ...(includeDiscounts
+ ? {
+ include: {
+ discounts: {
+ orderBy: {
+ createdAt: "asc",
+ },
+ },
+ },
+ }
+ : {}),
});
if (!program) {