We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf4fa6e commit 6d300c4Copy full SHA for 6d300c4
services/libs/data-access-layer/src/activities/sql.ts
@@ -1529,6 +1529,28 @@ export async function createOrUpdateRelations(
1529
}
1530
1531
1532
+ // if segmentId is empty, skip adding this activity relation
1533
+ if (data.segmentId == undefined || data.segmentId == null) {
1534
+ return
1535
+ }
1536
+
1537
+ // check segmentId exists
1538
+ const segment = await qe.select(
1539
+ `
1540
+ SELECT id
1541
+ FROM segments
1542
+ WHERE id = $(segmentId)
1543
+ `,
1544
+ {
1545
+ segmentId: data.segmentId,
1546
+ },
1547
+ )
1548
1549
+ if (segment.length === 0) {
1550
+ // segment not found, skip adding this activity relation
1551
1552
1553
1554
// check member exists
1555
let member = await qe.select(
1556
`
0 commit comments