Skip to content

Commit 9b8e82f

Browse files
committed
refactor: if opportunities are empty set cio to null
1 parent 3ecd66f commit 9b8e82f

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/cio.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,9 @@ export const identifyUserOpportunities = async ({
168168
select: ['opportunityId'],
169169
order: { createdAt: 'ASC' },
170170
});
171+
const ids = opportunities.map((opportunity) => opportunity.opportunityId);
171172
await cio.identify(userId, {
172-
opportunities: opportunities.map(
173-
(opportunity) => opportunity.opportunityId,
174-
),
173+
opportunities: ids || null,
175174
});
176175
};
177176

0 commit comments

Comments
 (0)