We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e94e119 commit bf4fa6eCopy full SHA for bf4fa6e
services/libs/data-access-layer/src/activities/sql.ts
@@ -1511,6 +1511,24 @@ export async function createOrUpdateRelations(
1511
}
1512
1513
1514
+ // check conversation exists
1515
+ if (data.conversationId !== undefined && data.conversationId !== null) {
1516
+ const conversation = await qe.select(
1517
+ `
1518
+ SELECT id
1519
+ FROM conversations
1520
+ WHERE id = $(conversationId)
1521
+ `,
1522
+ {
1523
+ conversationId: data.conversationId,
1524
+ },
1525
+ )
1526
+
1527
+ if (conversation.length === 0) {
1528
+ data.conversationId = null
1529
+ }
1530
1531
1532
// check member exists
1533
let member = await qe.select(
1534
`
0 commit comments