From 508d9e3738562a07cde827161e4582d3d46593a1 Mon Sep 17 00:00:00 2001 From: Shailesh Baldaniya Date: Mon, 12 Dec 2022 12:36:24 +0530 Subject: [PATCH 1/2] Fix handover error logs --- lib/Room.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Room.ts b/lib/Room.ts index 7045977..3a66f38 100644 --- a/lib/Room.ts +++ b/lib/Room.ts @@ -152,7 +152,7 @@ export const performHandover = async ( const offlineMessage: string = await getLivechatAgentConfig(read, rid, AppSetting.DialogflowHandoverFailedMessage); const handoverFailure = { error: error || offlineMessage, - errorMessage: 'Unable to reach Liveagent bot, it may be offline or disabled.', + errorMessage: closeChatDesc, dialogflow_SessionID: rid, visitorDetails: (({ id, token }) => ({ id, token }))(visitor), targetDepartment: livechatTransferData.targetDepartment, @@ -218,7 +218,7 @@ export const performHandover = async ( }); if (!result) { - await handleHandoverFailure('', closeChatDesc); + await handleHandoverFailure(Logs.HANDOVER_REQUEST_FAILED_ERROR, closeChatDesc); return false; } From f9fd295fabd7c2700e2f055f45f08d707367c81f Mon Sep 17 00:00:00 2001 From: Shailesh Baldaniya Date: Mon, 12 Dec 2022 12:37:02 +0530 Subject: [PATCH 2/2] Fix lint issue --- lib/Room.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Room.ts b/lib/Room.ts index 3a66f38..096d8f0 100644 --- a/lib/Room.ts +++ b/lib/Room.ts @@ -69,8 +69,8 @@ export const updateRoomCustomFields = async (rid: string, data: IRoomCustomField export const updateRoomSNSData = async (read: IRead, modify: IModify, rid: string, data: Record, isLog = false): Promise => { const customFields = await getRoomCustomFields(rid, read); if (customFields) { - const snsData = Object.assign({}, (customFields.sns || {}) as Record) ; - const logData = Object.assign({}, snsData.logData || {}) + const snsData = Object.assign({}, (customFields.sns || {}) as Record); + const logData = Object.assign({}, snsData.logData || {}); if (isLog) { snsData.logData = Object.assign(logData, data); } else {