Skip to content

Commit 6fd111b

Browse files
authored
Only remap-default-links/discount-codes for non-pending partners (dubinc#3738)
1 parent 8eec379 commit 6fd111b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/web/lib/api/groups/move-partners-to-group.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export async function movePartnersToGroup({
5656
select: {
5757
id: true,
5858
partnerId: true,
59+
status: true,
5960
partnerGroup: {
6061
select: {
6162
id: true,
@@ -170,7 +171,10 @@ export async function movePartnersToGroup({
170171
body: {
171172
programId,
172173
groupId: group.id,
173-
partnerIds,
174+
// skip remap-default-links / remap-discount-codes for pending applications (no links yet)
175+
partnerIds: programEnrollments
176+
.filter(({ status }) => status !== "pending")
177+
.map(({ partnerId }) => partnerId),
174178
userId: workspaceUserId,
175179
isGroupDeleted,
176180
},

0 commit comments

Comments
 (0)