2a81dcc7aaad45118ecbf0b960d54f2832456b8f
[motion2.git] / server / api / user-setting / user-setting.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 _0x6fa8=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','UserSetting'];(function(_0x1268f4,_0x147117){var _0x2f1b05=function(_0x4d634d){while(--_0x4d634d){_0x1268f4['push'](_0x1268f4['shift']());}};_0x2f1b05(++_0x147117);}(_0x6fa8,0x1e3));var _0x86fa=function(_0x4da690,_0x12d136){_0x4da690=_0x4da690-0x0;var _0x263c53=_0x6fa8[_0x4da690];return _0x263c53;};'use strict';var EventEmitter=require(_0x86fa('0x0'));var UserSetting=require(_0x86fa('0x1'))['db'][_0x86fa('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x86fa('0x3')](0x0);var events={'afterCreate':_0x86fa('0x4'),'afterUpdate':'update','afterDestroy':_0x86fa('0x5')};function emitEvent(_0x53cdbb){return function(_0x339384,_0x5d5ee7,_0x1b698e){UserSettingEvents[_0x86fa('0x6')](_0x53cdbb+':'+_0x339384['id'],_0x339384);UserSettingEvents[_0x86fa('0x6')](_0x53cdbb,_0x339384);_0x1b698e(null);};}for(var e in events){if(events[_0x86fa('0x7')](e)){var event=events[e];UserSetting[_0x86fa('0x8')](e,emitEvent(event));}}module['exports']=UserSettingEvents;