mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-02 17:03:42 -04:00
Use ZP custom school name field if available
This commit is contained in:
parent
fd0fdfe83e
commit
e834b93a0a
1 changed files with 3 additions and 2 deletions
|
@ -24,7 +24,6 @@ getZPContacts((err, emailContactMap) => {
|
||||||
const tasks = [];
|
const tasks = [];
|
||||||
for (const email in emailContactMap) {
|
for (const email in emailContactMap) {
|
||||||
const contact = emailContactMap[email];
|
const contact = emailContactMap[email];
|
||||||
// if (contact.organization !== 'Cabarrus County Schools') continue;
|
|
||||||
tasks.push(createUpsertCloseLeadFn(contact));
|
tasks.push(createUpsertCloseLeadFn(contact));
|
||||||
}
|
}
|
||||||
async.parallel(tasks, (err, results) => {
|
async.parallel(tasks, (err, results) => {
|
||||||
|
@ -147,8 +146,10 @@ function getZPContactsPage(contacts, searchQuery, done) {
|
||||||
if (err) return done(err);
|
if (err) return done(err);
|
||||||
const data = JSON.parse(body);
|
const data = JSON.parse(body);
|
||||||
for (let contact of data.contacts) {
|
for (let contact of data.contacts) {
|
||||||
|
let organization = contact.organization_name;
|
||||||
|
if (contact.custom_fields && contact.custom_fields.school_name) organization = contact.custom_fields.school_name;
|
||||||
contacts.push({
|
contacts.push({
|
||||||
organization: contact.organization_name,
|
organization: organization,
|
||||||
name: contact.name,
|
name: contact.name,
|
||||||
title: contact.title,
|
title: contact.title,
|
||||||
email: contact.email,
|
email: contact.email,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue