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.

Misc. fixes

Tim Wilson67291ec44303
diff --git a/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts b/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
index d0e5e6d7ce..340f8997e6 100644
--- a/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
+++ b/apps/web/app/(ee)/api/bounties/[bountyId]/route.ts
@@ -63,7 +63,7 @@ export const PATCH = withWorkspace(async ({ workspace, params, req }) => {
data: {
name,
description,
- startsAt,
+ startsAt: startsAt!, // Can remove the ! when we're on a newer TS version (currently 5.4.4)
endsAt,
rewardAmount,
submissionRequirements: submissionRequirements ?? Prisma.JsonNull,
diff --git a/apps/web/lib/api/bounties/get-bounty-or-throw.ts b/apps/web/lib/api/bounties/get-bounty-or-throw.ts
index a5388ad9cf..c1fb9c01dc 100644
--- a/apps/web/lib/api/bounties/get-bounty-or-throw.ts
+++ b/apps/web/lib/api/bounties/get-bounty-or-throw.ts
@@ -23,10 +23,21 @@ export const getBountyOrThrow = async ({
${
includeExpandedFields
? Prisma.sql`
- COUNT(DISTINCT pe.partnerId) as partnersCount
+ COUNT(DISTINCT pe.partnerId) as partnersCount,
+ COALESCE(
+ (
+ SELECT JSON_ARRAYAGG(
+ JSON_OBJECT('id', bgSub.groupId)
+ )
+ FROM BountyGroup bgSub
+ WHERE bgSub.bountyId = b.id
+ ),
+ JSON_ARRAY()
+ ) as groups
`
: Prisma.sql`
- 0 as partnersCount
+ 0 as partnersCount,
+ JSON_ARRAY() as groups
`
}
FROM Bounty b
@@ -54,5 +65,6 @@ export const getBountyOrThrow = async ({
return {
...bounties[0],
partnersCount: Number(bounties[0].partnersCount),
+ groups: bounties[0].groups.filter((group) => group !== null),
};
};
diff --git a/packages/email/src/templates/bounty-approved.tsx b/packages/email/src/templates/bounty-approved.tsx
index 72a0bb4816..32c3f19157 100644
--- a/packages/email/src/templates/bounty-approved.tsx
+++ b/packages/email/src/templates/bounty-approved.tsx
@@ -12,7 +12,7 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import { BountyThumbnailImage } from "src/components/bounty-thumbnail";
+import { BountyThumbnailImage } from "../components/bounty-thumbnail";
import { Footer } from "../components/footer";
export default function BountyApproved({
diff --git a/packages/email/src/templates/bounty-completed.tsx b/packages/email/src/templates/bounty-completed.tsx
index 9708679053..c896d1afac 100644
--- a/packages/email/src/templates/bounty-completed.tsx
+++ b/packages/email/src/templates/bounty-completed.tsx
@@ -12,7 +12,7 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import { BountyThumbnailImage } from "src/components/bounty-thumbnail";
+import { BountyThumbnailImage } from "../components/bounty-thumbnail";
import { Footer } from "../components/footer";
export default function BountyCompleted({
diff --git a/packages/email/src/templates/bounty-submitted.tsx b/packages/email/src/templates/bounty-submitted.tsx
index e7050f52c3..4070fb9881 100644
--- a/packages/email/src/templates/bounty-submitted.tsx
+++ b/packages/email/src/templates/bounty-submitted.tsx
@@ -12,7 +12,7 @@ import {
Tailwind,
Text,
} from "@react-email/components";
-import { BountyThumbnailImage } from "src/components/bounty-thumbnail";
+import { BountyThumbnailImage } from "../components/bounty-thumbnail";
import { Footer } from "../components/footer";
export default function BountySubmitted({