0751bbe9d5699f4159853d07f8418321e383001c
[motion2.git] / server / api / dashboardItem / dashboardItem.events.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xc54a=['hasOwnProperty','exports','events','../../mysqldb','DashboardItem','setMaxListeners','save','remove','emit'];(function(_0xe896bf,_0x4f8e5e){var _0x4c7a8a=function(_0x410ff2){while(--_0x410ff2){_0xe896bf['push'](_0xe896bf['shift']());}};_0x4c7a8a(++_0x4f8e5e);}(_0xc54a,0x1d6));var _0xac54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc54a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xac54('0x0'));var DashboardItem=require(_0xac54('0x1'))['db'][_0xac54('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xac54('0x3')](0x0);var events={'afterCreate':_0xac54('0x4'),'afterUpdate':'update','afterDestroy':_0xac54('0x5')};function emitEvent(_0x1af5ae){return function(_0x270b09,_0x36e66b,_0x1fc5ae){DashboardItemEvents[_0xac54('0x6')](_0x1af5ae+':'+_0x270b09['id'],_0x270b09);DashboardItemEvents[_0xac54('0x6')](_0x1af5ae,_0x270b09);_0x1fc5ae(null);};}for(var e in events){if(events[_0xac54('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xac54('0x8')]=DashboardItemEvents;