fff0f20ff35aec12b131508e4a7bd372c6d602cd
[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 _0x8769=['then','catch','lodash','util','api','bluebird','request-promise','../../config/environment','./userProfile.attributes','UserProfile','user_profiles','models','User','update','privacyEnabled'];(function(_0x18cb96,_0x57441e){var _0x281c8b=function(_0x18dc13){while(--_0x18dc13){_0x18cb96['push'](_0x18cb96['shift']());}};_0x281c8b(++_0x57441e);}(_0x8769,0x110));var _0x9876=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x8769[_0x101e7b];return _0x4995c0;};'use strict';var _=require(_0x9876('0x0'));var util=require(_0x9876('0x1'));var logger=require('../../config/logger')(_0x9876('0x2'));var moment=require('moment');var BPromise=require(_0x9876('0x3'));var rp=require(_0x9876('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9876('0x5'));var attributes=require(_0x9876('0x6'));module['exports']=function(_0x179357,_0x5a4149){return _0x179357['define'](_0x9876('0x7'),attributes,{'tableName':_0x9876('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2ff658,_0x43fc5d,_0x16d461){var _0x186fd3=_0x179357[_0x9876('0x9')];_0x186fd3[_0x9876('0xa')][_0x9876('0xb')]({'privacyEnabled':_0x2ff658[_0x9876('0xc')]},{'where':{'UserProfileId':_0x2ff658['id']}})[_0x9876('0xd')](function(){_0x16d461();})[_0x9876('0xe')](function(_0x29398f){_0x16d461(_0x29398f);});}}});};