Built motion from commit (unavailable).|2.5.28
[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 _0x422f=['./userProfile.attributes','exports','define','user_profiles','User','then','catch','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x38fcc1,_0x39bf14){var _0x53e6cb=function(_0x1a73ec){while(--_0x1a73ec){_0x38fcc1['push'](_0x38fcc1['shift']());}};_0x53e6cb(++_0x39bf14);}(_0x422f,0x1c7));var _0xf422=function(_0x42ea9d,_0x247f87){_0x42ea9d=_0x42ea9d-0x0;var _0x442d83=_0x422f[_0x42ea9d];return _0x442d83;};'use strict';var _=require('lodash');var util=require(_0xf422('0x0'));var logger=require('../../config/logger')(_0xf422('0x1'));var moment=require(_0xf422('0x2'));var BPromise=require('bluebird');var rp=require(_0xf422('0x3'));var fs=require('fs');var path=require(_0xf422('0x4'));var rimraf=require(_0xf422('0x5'));var config=require(_0xf422('0x6'));var attributes=require(_0xf422('0x7'));module[_0xf422('0x8')]=function(_0x3e3e5d,_0x13ed91){return _0x3e3e5d[_0xf422('0x9')]('UserProfile',attributes,{'tableName':_0xf422('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x1037fa,_0xc2c9f5,_0x23a1bf){var _0x53d577=_0x3e3e5d['models'];_0x53d577[_0xf422('0xb')]['update']({'privacyEnabled':_0x1037fa['privacyEnabled']},{'where':{'UserProfileId':_0x1037fa['id']}})[_0xf422('0xc')](function(){_0x23a1bf();})[_0xf422('0xd')](function(_0x25cd31){_0x23a1bf(_0x25cd31);});}}});};