From e9f645052a70c7912d489e06543c603f101ca957 Mon Sep 17 00:00:00 2001 From: Bright Date: Fri, 22 Nov 2024 12:05:39 +0700 Subject: [PATCH] =?UTF-8?q?add=20default=20=E0=B8=8A=E0=B9=88=E0=B8=AD?= =?UTF-8?q?=E0=B8=87=E0=B8=97=E0=B8=B2=E0=B8=87=E0=B8=81=E0=B8=B2=E0=B8=A3?= =?UTF-8?q?=E0=B8=AA=E0=B9=88=E0=B8=87=E0=B8=AA=E0=B8=B3=E0=B9=80=E0=B8=99?= =?UTF-8?q?=E0=B8=B2=20#99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/CommandController.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index d9170f68..ae1d3241 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -698,6 +698,23 @@ export class CommandController extends Controller { commandSend.lastUpdateFullName = request.user.name; commandSend.lastUpdatedAt = new Date(); await this.commandSendRepository.save(commandSend); + if(commandSend && commandSend.id) { + let _ccName = new Array("INBOX", "EMAIL"); + let _dataSendCC = new Array(); + for(let i=0; i<_ccName.length; i++) { + _dataSendCC.push({ + commandSendId: commandSend.id, + name: _ccName[i], + createdUserId: request.user.sub, + createdFullName: request.user.name, + createdAt: new Date(), + lastUpdateUserId: request.user.sub, + lastUpdateFullName: request.user.name, + lastUpdatedAt: new Date(), + }); + } + await this.commandSendCCRepository.save(_dataSendCC); + } }), );