We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cde6394 commit 39de1b4Copy full SHA for 39de1b4
src/common/opportunity/user.ts
@@ -1,4 +1,4 @@
1
-import type { EntityManager } from 'typeorm';
+import { IsNull, type EntityManager } from 'typeorm';
2
import { OpportunityJob } from '../../entity/opportunities/OpportunityJob';
3
import { updateFlagsStatement } from '../utils';
4
import type { Opportunity } from '../../entity/opportunities/Opportunity';
@@ -32,6 +32,9 @@ export const claimAnonOpportunities = async ({
32
.where("flags->>'anonUserId' = :anonUserId", {
33
anonUserId,
34
})
35
+ .andWhere({
36
+ organizationId: IsNull(), // only claim opportunities not linked to an organization yet
37
+ })
38
.returning(['id'])
39
.execute();
40
0 commit comments