Built motion from commit b5413ace.|2.6.9
[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 _0xaf04=['hook','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xaf04,0x9d));var _0x4af0=function(_0xf3e185,_0xbef8fa){_0xf3e185=_0xf3e185-0x0;var _0x2db9f4=_0xaf04[_0xf3e185];return _0x2db9f4;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x4af0('0x0')](0x0);var events={'afterCreate':_0x4af0('0x1'),'afterUpdate':'update','afterDestroy':_0x4af0('0x2')};function emitEvent(_0x4c925b){return function(_0x2c627f,_0x1f98e7,_0x2ee028){DashboardItemEvents['emit'](_0x4c925b+':'+_0x2c627f['id'],_0x2c627f);DashboardItemEvents[_0x4af0('0x3')](_0x4c925b,_0x2c627f);_0x2ee028(null);};}for(var e in events){if(events[_0x4af0('0x4')](e)){var event=events[e];DashboardItem[_0x4af0('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;