Skip to content

Commit 96b0f7b

Browse files
Filter out expired bounties in on the partner profile (#3334)
Co-authored-by: Steven Tey <stevensteel97@gmail.com>
1 parent 7404ea7 commit 96b0f7b

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

apps/web/app/(ee)/api/bounties/route.ts

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,29 @@ export const GET = withWorkspace(
5252
programId,
5353
// Filter only bounties the specified partner is eligible for
5454
...(programEnrollment && {
55-
OR: [
55+
AND: [
56+
// Filter out expired bounties
5657
{
57-
groups: {
58-
none: {},
59-
},
58+
OR: [{ endsAt: null }, { endsAt: { gt: new Date() } }],
6059
},
60+
// Filter by partner's group eligibility
6161
{
62-
groups: {
63-
some: {
64-
groupId:
65-
programEnrollment.groupId ||
66-
programEnrollment.program.defaultGroupId,
62+
OR: [
63+
{
64+
groups: {
65+
none: {},
66+
},
6767
},
68-
},
68+
{
69+
groups: {
70+
some: {
71+
groupId:
72+
programEnrollment.groupId ||
73+
programEnrollment.program.defaultGroupId,
74+
},
75+
},
76+
},
77+
],
6978
},
7079
],
7180
}),

0 commit comments

Comments
 (0)