cb53dd75372b5c39a1f6777c1def5e9cbe888dcf
[motion2.git] / server / api / faxAccount / faxAccount.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 _0x21a0=['../../mysqldb','FaxAccount','setMaxListeners','update','emit','hook','exports','events'];(function(_0x1ab430,_0x405e8b){var _0x1ec87c=function(_0x4a9ad2){while(--_0x4a9ad2){_0x1ab430['push'](_0x1ab430['shift']());}};_0x1ec87c(++_0x405e8b);}(_0x21a0,0xdf));var _0x021a=function(_0x3577ad,_0x11e389){_0x3577ad=_0x3577ad-0x0;var _0x56c663=_0x21a0[_0x3577ad];return _0x56c663;};'use strict';var EventEmitter=require(_0x021a('0x0'));var FaxAccount=require(_0x021a('0x1'))['db'][_0x021a('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x021a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x021a('0x4'),'afterDestroy':'remove'};function emitEvent(_0x12c5d9){return function(_0x684bdc,_0x1dd190,_0x1ead86){FaxAccountEvents[_0x021a('0x5')](_0x12c5d9+':'+_0x684bdc['id'],_0x684bdc);FaxAccountEvents[_0x021a('0x5')](_0x12c5d9,_0x684bdc);_0x1ead86(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x021a('0x6')](e,emitEvent(event));}}module[_0x021a('0x7')]=FaxAccountEvents;