Skip to content

Commit a54cdb0

Browse files
Test for vanId when manually opting someone out
1 parent 361e16f commit a54cdb0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/server/api/schema.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,15 @@ const rootMutations = {
13451345

13461346
if (!await Van.available(organization)) return newContact;
13471347

1348+
// Checking that contact contains a vanId
1349+
// If not, return and skip next steps
1350+
try {
1351+
const c = JSON.stringify(contact.customFiels);
1352+
if (!"vanId" in c) return newContact;
1353+
} catch (exception) {
1354+
console.log(exception)
1355+
}
1356+
13481357
console.log(
13491358
"createOptOut VAN"
13501359
);

0 commit comments

Comments
 (0)