From a8a3f595ec4df9e8b74d45bcf67ab2719776cdc4 Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 28 Aug 2018 23:45:31 +0800 Subject: [PATCH] fix var dup --- libs/line-message/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/line-message/index.js b/libs/line-message/index.js index 2ba76cc..703732a 100644 --- a/libs/line-message/index.js +++ b/libs/line-message/index.js @@ -35,9 +35,9 @@ const textMessage = async (evt) => { } } -const saveToLog = async (source, text = '') => { +const saveToLog = async (source, msg = '') => { if (!source || typeof source !== 'object') return null - if (typeof text !== 'string' || text.length === 0) return null + if (typeof msg !== 'string' || msg.length === 0) return null let {groupId, userId} = source if (typeof groupId !== 'string' || groupId.length === 0) return null if (typeof userId !== 'string' || userId.length === 0) return null @@ -61,7 +61,7 @@ const saveToLog = async (source, text = '') => { await db.query({text, values}) } text = `insert into "public"."line_message_log" ("group", "user", "message") values ($1, $2, $3)` - values = [groupId, userId, text] + values = [groupId, userId, msg] await db.query({text, values}) } catch (err) { console.log('save log error :::: ', err)