2494350522846767257b23ed005066ed4a77435a
[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 _0x04fc=['update','remove','emit','hasOwnProperty','exports','events','DashboardItem','setMaxListeners','save'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x04fc,0x11c));var _0xc04f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x04fc[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0xc04f('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xc04f('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xc04f('0x2')](0x0);var events={'afterCreate':_0xc04f('0x3'),'afterUpdate':_0xc04f('0x4'),'afterDestroy':_0xc04f('0x5')};function emitEvent(_0x5230a7){return function(_0x4fb694,_0x73d3ce,_0x36e748){DashboardItemEvents[_0xc04f('0x6')](_0x5230a7+':'+_0x4fb694['id'],_0x4fb694);DashboardItemEvents[_0xc04f('0x6')](_0x5230a7,_0x4fb694);_0x36e748(null);};}for(var e in events){if(events[_0xc04f('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xc04f('0x8')]=DashboardItemEvents;