Built motion from commit 67e5df37.|2.0.66
[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 _0xf93b=['../../mysqldb','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x86ea1d,_0x34a7){var _0x32d2a7=function(_0x3af2af){while(--_0x3af2af){_0x86ea1d['push'](_0x86ea1d['shift']());}};_0x32d2a7(++_0x34a7);}(_0xf93b,0x8b));var _0xbf93=function(_0x36bfe3,_0x358938){_0x36bfe3=_0x36bfe3-0x0;var _0x9b0436=_0xf93b[_0x36bfe3];return _0x9b0436;};'use strict';var EventEmitter=require(_0xbf93('0x0'));var DashboardItem=require(_0xbf93('0x1'))['db'][_0xbf93('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xbf93('0x3')](0x0);var events={'afterCreate':_0xbf93('0x4'),'afterUpdate':_0xbf93('0x5'),'afterDestroy':_0xbf93('0x6')};function emitEvent(_0x16659c){return function(_0x4c7c76,_0x29c277,_0x191328){DashboardItemEvents[_0xbf93('0x7')](_0x16659c+':'+_0x4c7c76['id'],_0x4c7c76);DashboardItemEvents[_0xbf93('0x7')](_0x16659c,_0x4c7c76);_0x191328(null);};}for(var e in events){if(events[_0xbf93('0x8')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xbf93('0x9')]=DashboardItemEvents;