6cbd78c174116701eba39ccd41a5161bdb967654
[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 _0x9cc3=['exports','events','../../mysqldb','DashboardItem','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x56502e,_0x8c301d){var _0x3934ae=function(_0x5befd6){while(--_0x5befd6){_0x56502e['push'](_0x56502e['shift']());}};_0x3934ae(++_0x8c301d);}(_0x9cc3,0xeb));var _0x39cc=function(_0x3c1791,_0x1a6bf4){_0x3c1791=_0x3c1791-0x0;var _0x378d3=_0x9cc3[_0x3c1791];return _0x378d3;};'use strict';var EventEmitter=require(_0x39cc('0x0'));var DashboardItem=require(_0x39cc('0x1'))['db'][_0x39cc('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x39cc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x39cc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x29f48d){return function(_0x317c43,_0x33f5f6,_0x35e85f){DashboardItemEvents['emit'](_0x29f48d+':'+_0x317c43['id'],_0x317c43);DashboardItemEvents[_0x39cc('0x5')](_0x29f48d,_0x317c43);_0x35e85f(null);};}for(var e in events){if(events[_0x39cc('0x6')](e)){var event=events[e];DashboardItem[_0x39cc('0x7')](e,emitEvent(event));}}module[_0x39cc('0x8')]=DashboardItemEvents;