Skip to content

Commit

Permalink
fix: Bullhorn note get
Browse files Browse the repository at this point in the history
  • Loading branch information
DaKingKong committed Jan 3, 2025
1 parent 36d732d commit de39927
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/adapters/bullhorn/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ async function createContact({ user, authHeader, phoneNumber, newContactName, ne
async function createCallLog({ user, contactInfo, authHeader, callLog, note, additionalSubmission, aiNote, transcript }) {
const noteActions = additionalSubmission.noteActions ?? '';
const subject = callLog.customSubject ?? `${callLog.direction} Call ${callLog.direction === 'Outbound' ? `to ${contactInfo.name}` : `from ${contactInfo.name}`}`;
let comments = '<b>Agent notes</b>';;
let comments = '<b>Agent notes</b><br>';;
if (user.userSettings?.addCallLogNote?.value ?? true) { comments = upsertCallAgentNote({ body: comments, note }); }
comments += '<b>Call details</b><ul>';
if (user.userSettings?.addCallLogSubject?.value ?? true) { comments = upsertCallSubject({ body: comments, subject }); }
Expand Down Expand Up @@ -709,6 +709,7 @@ async function getCallLog({ user, callLogId, authHeader }) {
}
const logBody = getLogRes.data.data.comments;
const note = logBody.split('<b>Agent notes</b><br>')[1]?.split('<br><br>')[0] ?? '';
const subject = logBody.split('</ul>')[0]?.split('<li><b>Summary</b>: ')[1]?.split('<li><b>')[0] ?? '';
const totalContactCount = getLogRes.data.data.clientContacts.total + getLogRes.data.data.candidates.total;
let contact = {
firstName: '',
Expand All @@ -719,7 +720,7 @@ async function getCallLog({ user, callLogId, authHeader }) {
}
return {
callLogInfo: {
subject: getLogRes.data.data.comments.split('<li><b>Summary</b>: ')[1]?.split('<li><b>')[0] ?? '',
subject,
note,
contactName: `${contact.firstName} ${contact.lastName}`
},
Expand Down Expand Up @@ -753,7 +754,7 @@ function upsertCallAgentNote({ body, note }) {
body = body.replace(noteRegex, `<b>Agent notes</b><br>${note}<br><br>`);
}
else {
body += `<br>${note}<br><br>`;
body += `${note}<br><br>`;
}
return body;
}
Expand Down

0 comments on commit de39927

Please sign in to comment.