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 1ee0dc9 commit 2c49057Copy full SHA for 2c49057
1 file changed
services/libs/data-access-layer/src/mailinglist/index.ts
@@ -48,11 +48,13 @@ export async function findMailingListsOwnedByOtherIntegration(
48
49
const rows = await qx.select(
50
`
51
- SELECT "sourceUrl"
52
- FROM mailinglist.lists
53
- WHERE "integrationId" != $(integrationId)::uuid
54
- AND "deletedAt" IS NULL
55
- AND "sourceUrl" IN (
+ SELECT l."sourceUrl"
+ FROM mailinglist.lists l
+ JOIN public.integrations i ON i.id = l."integrationId"
+ WHERE l."integrationId" != $(integrationId)::uuid
+ AND l."deletedAt" IS NULL
56
+ AND i."deletedAt" IS NULL
57
+ AND l."sourceUrl" IN (
58
SELECT v."sourceUrl" FROM json_to_recordset($(lists)::json) AS v(name text, "sourceUrl" text)
59
)
60
`,
0 commit comments