Built motion from commit (unavailable).|2.5.22
[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 _0xf682=['../../mysqldb','DashboardItem','remove','emit','hasOwnProperty','hook'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf682,0x1a4));var _0x2f68=function(_0x133bfb,_0x2e8a05){_0x133bfb=_0x133bfb-0x0;var _0x28e81c=_0xf682[_0x133bfb];return _0x28e81c;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x2f68('0x0'))['db'][_0x2f68('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2f68('0x2')};function emitEvent(_0x349aa1){return function(_0x3973f1,_0x34adfb,_0x3c7be8){DashboardItemEvents[_0x2f68('0x3')](_0x349aa1+':'+_0x3973f1['id'],_0x3973f1);DashboardItemEvents['emit'](_0x349aa1,_0x3973f1);_0x3c7be8(null);};}for(var e in events){if(events[_0x2f68('0x4')](e)){var event=events[e];DashboardItem[_0x2f68('0x5')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;