fix: changed default text to username and surname
parent
e2372fad37
commit
e76cf69f3f
|
@ -8,7 +8,7 @@ const CRM = require('../models/CRM')
|
||||||
const requestConfigHeader = require('./requestConfigHeader')
|
const requestConfigHeader = require('./requestConfigHeader')
|
||||||
const sendMessageSocket = require('./sendMessageSocket')
|
const sendMessageSocket = require('./sendMessageSocket')
|
||||||
|
|
||||||
async function createContact(companyId, rest, authentication, crmPhone, crmFirstName = 'unnamed', crmLastName = 'no surname', crmEmail = '', test = {}) {
|
async function createContact(companyId, rest, authentication, crmPhone, crmFirstName = 'Username', crmLastName = 'Last name', crmEmail = '', test = {}) {
|
||||||
let { request, body, response } = findProperty(rest, 'createContactRecord')
|
let { request, body, response } = findProperty(rest, 'createContactRecord')
|
||||||
|
|
||||||
const { requestContentType, requestEncoding, requestType, responseType, url } = request
|
const { requestContentType, requestEncoding, requestType, responseType, url } = request
|
||||||
|
@ -29,7 +29,7 @@ async function createContact(companyId, rest, authentication, crmPhone, crmFirst
|
||||||
body[prop] = variable
|
body[prop] = variable
|
||||||
} else {
|
} else {
|
||||||
if (body[prop] == 'crmLastName' && !crmLastName) {
|
if (body[prop] == 'crmLastName' && !crmLastName) {
|
||||||
body[prop] = 'unnamed'
|
body[prop] = 'Username'
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
delete body[prop]
|
delete body[prop]
|
||||||
|
|
|
@ -10,7 +10,7 @@ const requestConfigHeader = require('./requestConfigHeader')
|
||||||
const sendEventTicketCreatedToSocket = require('./sendEventTicketCreatedToSocket')
|
const sendEventTicketCreatedToSocket = require('./sendEventTicketCreatedToSocket')
|
||||||
|
|
||||||
|
|
||||||
async function createTicket(companyId, rest, authentication, crmPhone, crmFirstName = 'unnamed', crmLastName = 'no surname', crmEmail = '', test = {}, crmContactId, crmAgent) {
|
async function createTicket(companyId, rest, authentication, crmPhone, crmFirstName = 'Username', crmLastName = 'Last name', crmEmail = '', test = {}, crmContactId, crmAgent) {
|
||||||
|
|
||||||
let { request, body, response } = findProperty(rest, 'createTicketRecord')
|
let { request, body, response } = findProperty(rest, 'createTicketRecord')
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ async function createTicket(companyId, rest, authentication, crmPhone, crmFirstN
|
||||||
body[prop] = variable
|
body[prop] = variable
|
||||||
} else {
|
} else {
|
||||||
if (body[prop] == 'crmLastName' && !crmLastName) {
|
if (body[prop] == 'crmLastName' && !crmLastName) {
|
||||||
body[prop] = 'unnamed'
|
body[prop] = 'Username'
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
delete body[prop]
|
delete body[prop]
|
||||||
|
|
|
@ -5,7 +5,7 @@ const findProperty = require('./findProperty')
|
||||||
|
|
||||||
const journalingRequest = require('./journalingRequest')
|
const journalingRequest = require('./journalingRequest')
|
||||||
|
|
||||||
async function journaling(companyId, operation, crmPhone, crmAgent, crmCallDuration = 0, crmFirstName ='unnamed') {
|
async function journaling(companyId, operation, crmPhone, crmAgent, crmCallDuration = 0, crmFirstName ='Username') {
|
||||||
|
|
||||||
const crmFiles = await loadCRM(companyId)
|
const crmFiles = await loadCRM(companyId)
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ async function templateValidator(crmPhoneTest, crm, companyId) {
|
||||||
rest = crm.crmRest,
|
rest = crm.crmRest,
|
||||||
authentication = crm.authentication,
|
authentication = crm.authentication,
|
||||||
crmPhone = phoneTest,
|
crmPhone = phoneTest,
|
||||||
crmFirstName = 'unnamed',
|
crmFirstName = 'Username',
|
||||||
crmLastName = '',
|
crmLastName = '',
|
||||||
crmEmail = '',
|
crmEmail = '',
|
||||||
test = { testing: true })
|
test = { testing: true })
|
||||||
|
|
|
@ -10,7 +10,7 @@ const createTicket = require('./createTicket')
|
||||||
const lookupCRMTicket = require('./lookupCRMTicket')
|
const lookupCRMTicket = require('./lookupCRMTicket')
|
||||||
|
|
||||||
|
|
||||||
async function ticketCRM(companyId, crmPhone, crmAgent, crmFirstName = 'unnamed') {
|
async function ticketCRM(companyId, crmPhone, crmAgent, crmFirstName = 'Username') {
|
||||||
|
|
||||||
const crmFiles = await loadCRM(companyId)
|
const crmFiles = await loadCRM(companyId)
|
||||||
|
|
||||||
|
@ -89,7 +89,7 @@ async function _createTicket(rest, crmPhone, companyId, authentication, crmFirst
|
||||||
rest,
|
rest,
|
||||||
authentication,
|
authentication,
|
||||||
crmPhone,
|
crmPhone,
|
||||||
crmFirstName = 'unnamed',
|
crmFirstName = 'Username',
|
||||||
crmLastName = '',
|
crmLastName = '',
|
||||||
crmEmail = '',
|
crmEmail = '',
|
||||||
test = { testing: false },
|
test = { testing: false },
|
||||||
|
|
Loading…
Reference in New Issue