0433e6339df5a88f3faae3ea1f46dd49ec6e1a98
[motion-next.git] / server / api / userProfile / userProfile.events.js
1 const a668_0x4d76=['remove','undefined','update','setMaxListeners','emit','exports','UserProfile','addHook','events'];(function(_0x42a263,_0x4d76b6){const _0x2c200e=function(_0x5050b5){while(--_0x5050b5){_0x42a263['push'](_0x42a263['shift']());}};_0x2c200e(++_0x4d76b6);}(a668_0x4d76,0x1a3));const a668_0x2c20=function(_0x42a263,_0x4d76b6){_0x42a263=_0x42a263-0x0;let _0x2c200e=a668_0x4d76[_0x42a263];return _0x2c200e;};const _0xa982e6=a668_0x2c20;'use strict';const EventEmitter=require(_0xa982e6('0x3')),UserProfile=require('../../mysqldb')['db'][_0xa982e6('0x1')],UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa982e6('0x7')](0x0);const events={'afterCreate':'save','afterUpdate':_0xa982e6('0x6'),'afterDestroy':_0xa982e6('0x4')};function emitEvent(_0x5050b5){return function(_0x48d9ec){const _0x444933=a668_0x2c20;UserProfileEvents[_0x444933('0x8')](_0x5050b5+':'+_0x48d9ec['id'],_0x48d9ec),UserProfileEvents[_0x444933('0x8')](_0x5050b5,_0x48d9ec);};}for(const e in events){if(typeof events[e]!==_0xa982e6('0x5')){const event=events[e];UserProfile[_0xa982e6('0x2')](e,emitEvent(event));}}module[_0xa982e6('0x0')]=UserProfileEvents;