1fb6f414481d89c2db5517d7fc7b8949141e4eb0
[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 _0xf6e9=['exports','events','DashboardItem','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0xd5677e,_0x154bac){var _0x24d6c8=function(_0x1c8aab){while(--_0x1c8aab){_0xd5677e['push'](_0xd5677e['shift']());}};_0x24d6c8(++_0x154bac);}(_0xf6e9,0x137));var _0x9f6e=function(_0x3e85c8,_0x42d93f){_0x3e85c8=_0x3e85c8-0x0;var _0x198f4e=_0xf6e9[_0x3e85c8];return _0x198f4e;};'use strict';var EventEmitter=require(_0x9f6e('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x9f6e('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9f6e('0x2')](0x0);var events={'afterCreate':_0x9f6e('0x3'),'afterUpdate':_0x9f6e('0x4'),'afterDestroy':_0x9f6e('0x5')};function emitEvent(_0x427ea5){return function(_0x403beb,_0x59ec6e,_0xf935c){DashboardItemEvents[_0x9f6e('0x6')](_0x427ea5+':'+_0x403beb['id'],_0x403beb);DashboardItemEvents['emit'](_0x427ea5,_0x403beb);_0xf935c(null);};}for(var e in events){if(events[_0x9f6e('0x7')](e)){var event=events[e];DashboardItem[_0x9f6e('0x8')](e,emitEvent(event));}}module[_0x9f6e('0x9')]=DashboardItemEvents;