Built motion from commit (unavailable).|2.5.29
[motion2.git] / server / api / userProfile / userProfile.model.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 _0x2547=['moment','bluebird','request-promise','path','rimraf','./userProfile.attributes','exports','UserProfile','user_profiles','update','privacyEnabled','then','catch','util','../../config/logger','api'];(function(_0x2126e7,_0x33520d){var _0x585aa7=function(_0x523e81){while(--_0x523e81){_0x2126e7['push'](_0x2126e7['shift']());}};_0x585aa7(++_0x33520d);}(_0x2547,0x1cd));var _0x7254=function(_0x280e31,_0x1fa1a3){_0x280e31=_0x280e31-0x0;var _0x3613be=_0x2547[_0x280e31];return _0x3613be;};'use strict';var _=require('lodash');var util=require(_0x7254('0x0'));var logger=require(_0x7254('0x1'))(_0x7254('0x2'));var moment=require(_0x7254('0x3'));var BPromise=require(_0x7254('0x4'));var rp=require(_0x7254('0x5'));var fs=require('fs');var path=require(_0x7254('0x6'));var rimraf=require(_0x7254('0x7'));var config=require('../../config/environment');var attributes=require(_0x7254('0x8'));module[_0x7254('0x9')]=function(_0x67f427,_0x119f66){return _0x67f427['define'](_0x7254('0xa'),attributes,{'tableName':_0x7254('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x395913,_0x5da1ec,_0x2a2f82){var _0x555b2e=_0x67f427['models'];_0x555b2e['User'][_0x7254('0xc')]({'privacyEnabled':_0x395913[_0x7254('0xd')]},{'where':{'UserProfileId':_0x395913['id']}})[_0x7254('0xe')](function(){_0x2a2f82();})[_0x7254('0xf')](function(_0x6828b6){_0x2a2f82(_0x6828b6);});}}});};