Built motion from commit 953226e6.|2.6.32
[motion2.git] / server / api / squareProject / squareProject.controller.js
index fe0fbbb..0153ab0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x68ce=['register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','UserProfileResource','publish','stringify','end','sendStatus','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','show','keys','find','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SquareProjects','UserProfileSection','userProfileId','autoAssociation','catch','body','params','agi','pick','production','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x194b77,_0x15a28d){var _0x2766e0=function(_0x5c2af2){while(--_0x5c2af2){_0x194b77['push'](_0x194b77['shift']());}};_0x2766e0(++_0x15a28d);}(_0x68ce,0x1e0));var _0xe68c=function(_0x129b52,_0x29a8f3){_0x129b52=_0x129b52-0x0;var _0x5e0266=_0x68ce[_0x129b52];return _0x5e0266;};'use strict';var _=require(_0xe68c('0x0'));var Redis=require(_0xe68c('0x1'));var qs=require(_0xe68c('0x2'));var logger=require(_0xe68c('0x3'))(_0xe68c('0x4'));var config=require(_0xe68c('0x5'));var db=require(_0xe68c('0x6'))['db'];config[_0xe68c('0x7')]=_[_0xe68c('0x8')](config['redis'],{'host':_0xe68c('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./squareProject.socket')[_0xe68c('0xa')](socket);function respondWithResult(_0x8a338e,_0x428e52){_0x428e52=_0x428e52||0xc8;return function(_0x13d70f){if(_0x13d70f){return _0x8a338e[_0xe68c('0xb')](_0x428e52)[_0xe68c('0xc')](_0x13d70f);}};}function respondWithFilteredResult(_0x23acda,_0xd4e680){return function(_0x159796){if(_0x159796){var _0x5deea0=typeof _0xd4e680[_0xe68c('0xd')]===_0xe68c('0xe')&&typeof _0xd4e680[_0xe68c('0xf')]==='undefined';var _0x34d797=_0x159796['count'];var _0x20eff2=_0x5deea0?0x0:_0xd4e680['offset'];var _0x3a0795=_0x5deea0?_0x159796[_0xe68c('0x10')]:_0xd4e680[_0xe68c('0xd')]+_0xd4e680[_0xe68c('0xf')];var _0x420604;if(_0x3a0795>=_0x34d797){_0x3a0795=_0x34d797;_0x420604=0xc8;}else{_0x420604=0xce;}_0x23acda[_0xe68c('0xb')](_0x420604);return _0x23acda[_0xe68c('0x11')](_0xe68c('0x12'),_0x20eff2+'-'+_0x3a0795+'/'+_0x34d797)['json'](_0x159796);}return null;};}function saveUpdates(_0x287662){return function(_0x32140e){if(_0x32140e){return _0x32140e[_0xe68c('0x13')](_0x287662)[_0xe68c('0x14')](function(_0x56b672){return _0x56b672;});}return null;};}function removeEntity(_0x47360f){return function(_0x113a85){if(_0x113a85){return _0x113a85[_0xe68c('0x15')]()[_0xe68c('0x14')](function(){var _0x307421=_0x113a85['get']({'plain':!![]});var _0x511761='SquareProjects';return db[_0xe68c('0x16')][_0xe68c('0x15')]({'where':{'type':_0x511761,'resourceId':_0x307421['id']}})[_0xe68c('0x14')](function(){return _0x113a85;});})[_0xe68c('0x14')](function(){var _0x43fa45=new Redis(config[_0xe68c('0x7')]);_0x43fa45[_0xe68c('0x17')]('agi',JSON[_0xe68c('0x18')]({'id':_0x113a85['id'],'deleted':!![]}));})[_0xe68c('0x14')](function(){_0x47360f['status'](0xcc)[_0xe68c('0x19')]();});}};}function handleEntityNotFound(_0x3fa3fb){return function(_0x64ae5b){if(!_0x64ae5b){_0x3fa3fb[_0xe68c('0x1a')](0x194);}return _0x64ae5b;};}function handleError(_0x5a314b,_0x402d27){_0x402d27=_0x402d27||0x1f4;return function(_0xc014bd){logger[_0xe68c('0x1b')](_0xc014bd[_0xe68c('0x1c')]);if(_0xc014bd['name']){delete _0xc014bd[_0xe68c('0x1d')];}_0x5a314b[_0xe68c('0xb')](_0x402d27)[_0xe68c('0x1e')](_0xc014bd);};}exports[_0xe68c('0x1f')]=function(_0x2de56b,_0x5918eb){var _0x1af911={},_0x5c48ac={},_0x3b95eb={'count':0x0,'rows':[]};var _0x5638cc=_[_0xe68c('0x20')](db[_0xe68c('0x21')][_0xe68c('0x22')],function(_0x5d9264){return{'name':_0x5d9264[_0xe68c('0x23')],'type':_0x5d9264[_0xe68c('0x24')]['key']};});_0x5c48ac[_0xe68c('0x25')]=_['map'](_0x5638cc,'name');_0x5c48ac['query']=_['keys'](_0x2de56b[_0xe68c('0x26')]);_0x5c48ac[_0xe68c('0x27')]=_['intersection'](_0x5c48ac[_0xe68c('0x25')],_0x5c48ac['query']);_0x1af911[_0xe68c('0x28')]=_[_0xe68c('0x29')](_0x5c48ac[_0xe68c('0x25')],qs[_0xe68c('0x2a')](_0x2de56b[_0xe68c('0x26')][_0xe68c('0x2a')]));_0x1af911[_0xe68c('0x28')]=_0x1af911[_0xe68c('0x28')]['length']?_0x1af911[_0xe68c('0x28')]:_0x5c48ac[_0xe68c('0x25')];if(!_0x2de56b[_0xe68c('0x26')]['hasOwnProperty'](_0xe68c('0x2b'))){_0x1af911[_0xe68c('0xf')]=qs['limit'](_0x2de56b[_0xe68c('0x26')][_0xe68c('0xf')]);_0x1af911[_0xe68c('0xd')]=qs[_0xe68c('0xd')](_0x2de56b[_0xe68c('0x26')][_0xe68c('0xd')]);}_0x1af911[_0xe68c('0x2c')]=qs[_0xe68c('0x2d')](_0x2de56b['query'][_0xe68c('0x2d')]);_0x1af911[_0xe68c('0x2e')]=qs[_0xe68c('0x27')](_['pick'](_0x2de56b[_0xe68c('0x26')],_0x5c48ac['filters']),_0x5638cc);if(_0x2de56b[_0xe68c('0x26')][_0xe68c('0x2f')]){_0x1af911[_0xe68c('0x2e')]=_[_0xe68c('0x30')](_0x1af911['where'],{'$or':_[_0xe68c('0x20')](_0x5638cc,function(_0xf51088){if(_0xf51088[_0xe68c('0x24')]!==_0xe68c('0x31')){var _0x2b03f8={};_0x2b03f8[_0xf51088[_0xe68c('0x1d')]]={'$like':'%'+_0x2de56b['query']['filter']+'%'};return _0x2b03f8;}})});}_0x1af911=_[_0xe68c('0x30')]({},_0x1af911,_0x2de56b[_0xe68c('0x32')]);var _0x23ada2={'where':_0x1af911[_0xe68c('0x2e')]};return db['SquareProject'][_0xe68c('0x10')](_0x23ada2)['then'](function(_0x5b440f){_0x3b95eb['count']=_0x5b440f;if(_0x2de56b[_0xe68c('0x26')]['includeAll']){_0x1af911[_0xe68c('0x33')]=[{'all':!![]}];}return db[_0xe68c('0x21')][_0xe68c('0x34')](_0x1af911);})['then'](function(_0xd31fd2){_0x3b95eb['rows']=_0xd31fd2;return _0x3b95eb;})[_0xe68c('0x14')](respondWithFilteredResult(_0x5918eb,_0x1af911))['catch'](handleError(_0x5918eb,null));};exports[_0xe68c('0x35')]=function(_0x1d1f0d,_0x44880f){var _0x1efd2d={'raw':![],'where':{'id':_0x1d1f0d['params']['id']}},_0x54a280={};_0x54a280[_0xe68c('0x25')]=_[_0xe68c('0x36')](db[_0xe68c('0x21')][_0xe68c('0x22')]);_0x54a280[_0xe68c('0x26')]=_[_0xe68c('0x36')](_0x1d1f0d['query']);_0x54a280[_0xe68c('0x27')]=_[_0xe68c('0x29')](_0x54a280['model'],_0x54a280[_0xe68c('0x26')]);_0x1efd2d[_0xe68c('0x28')]=_['intersection'](_0x54a280[_0xe68c('0x25')],qs[_0xe68c('0x2a')](_0x1d1f0d['query'][_0xe68c('0x2a')]));_0x1efd2d[_0xe68c('0x28')]=_0x1efd2d[_0xe68c('0x28')]['length']?_0x1efd2d[_0xe68c('0x28')]:_0x54a280[_0xe68c('0x25')];if(_0x1d1f0d['query']['includeAll']){_0x1efd2d[_0xe68c('0x33')]=[{'all':!![]}];}_0x1efd2d=_[_0xe68c('0x30')]({},_0x1efd2d,_0x1d1f0d[_0xe68c('0x32')]);return db[_0xe68c('0x21')][_0xe68c('0x37')](_0x1efd2d)['then'](handleEntityNotFound(_0x44880f,null))[_0xe68c('0x14')](respondWithResult(_0x44880f,null))['catch'](handleError(_0x44880f,null));};exports['create']=function(_0x4f5215,_0x428df6){return db[_0xe68c('0x21')]['create'](_0x4f5215['body'],{})[_0xe68c('0x14')](function(_0x3716dc){var _0x12d389=_0x4f5215[_0xe68c('0x38')][_0xe68c('0x39')]({'plain':!![]});if(!_0x12d389)throw new Error(_0xe68c('0x3a'));if(_0x12d389[_0xe68c('0x3b')]===_0xe68c('0x38')){var _0x316dbb=_0x3716dc[_0xe68c('0x39')]({'plain':!![]});var _0x1040bb=_0xe68c('0x3c');return db[_0xe68c('0x3d')][_0xe68c('0x37')]({'where':{'name':_0x1040bb,'userProfileId':_0x12d389[_0xe68c('0x3e')]},'raw':!![]})['then'](function(_0x251bf6){if(_0x251bf6&&_0x251bf6[_0xe68c('0x3f')]===0x0){return db[_0xe68c('0x16')]['create']({'name':_0x316dbb[_0xe68c('0x1d')],'resourceId':_0x316dbb['id'],'type':_0x251bf6[_0xe68c('0x1d')],'sectionId':_0x251bf6['id']},{})[_0xe68c('0x14')](function(){return _0x3716dc;});}else{return _0x3716dc;}})[_0xe68c('0x40')](function(_0x13d874){logger[_0xe68c('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x13d874);throw _0x13d874;});}return _0x3716dc;})[_0xe68c('0x14')](respondWithResult(_0x428df6,0xc9))[_0xe68c('0x40')](handleError(_0x428df6,null));};exports['update']=function(_0x21f55b,_0x48509e){if(_0x21f55b[_0xe68c('0x41')]['id']){delete _0x21f55b[_0xe68c('0x41')]['id'];}return db[_0xe68c('0x21')][_0xe68c('0x37')]({'where':{'id':_0x21f55b[_0xe68c('0x42')]['id']}})[_0xe68c('0x14')](handleEntityNotFound(_0x48509e,null))['then'](saveUpdates(_0x21f55b['body'],null))[_0xe68c('0x14')](function(_0x2f3f59){if(!_0x2f3f59)return;var _0x50bbc7=_0x2f3f59[_0xe68c('0x39')]({'plain':!![]});return _0x50bbc7;})[_0xe68c('0x14')](function(_0xd157ce){var _0x4471c8=new Redis(config['redis']);_0x4471c8[_0xe68c('0x17')](_0xe68c('0x43'),JSON[_0xe68c('0x18')](_[_0xe68c('0x44')](_0xd157ce,['id',_0xe68c('0x1d'),_0xe68c('0x45')])));return _0xd157ce;})['then'](respondWithResult(_0x48509e,null))[_0xe68c('0x40')](handleError(_0x48509e,null));};exports[_0xe68c('0x15')]=function(_0x29befb,_0x1f4069){return db[_0xe68c('0x21')]['find']({'where':{'id':_0x29befb[_0xe68c('0x42')]['id']}})[_0xe68c('0x14')](handleEntityNotFound(_0x1f4069,null))[_0xe68c('0x14')](removeEntity(_0x1f4069,null))[_0xe68c('0x40')](handleError(_0x1f4069,null));};
\ No newline at end of file
+var _0x4a90=['destroy','get','SquareProjects','publish','stringify','end','sendStatus','error','stack','name','send','SquareProject','rawAttributes','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','agi','production','lodash','ioredis','../../components/parsers/qs','api','redis','socket.io-emitter','./squareProject.socket','register','status','json','offset','undefined','count','limit','set','Content-Range','update','then'];(function(_0x420300,_0x806d9c){var _0x4b464d=function(_0x3738fd){while(--_0x3738fd){_0x420300['push'](_0x420300['shift']());}};_0x4b464d(++_0x806d9c);}(_0x4a90,0x102));var _0x04a9=function(_0x5618be,_0x46c435){_0x5618be=_0x5618be-0x0;var _0x9571f3=_0x4a90[_0x5618be];return _0x9571f3;};'use strict';var _=require(_0x04a9('0x0'));var Redis=require(_0x04a9('0x1'));var qs=require(_0x04a9('0x2'));var logger=require('../../config/logger')(_0x04a9('0x3'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x04a9('0x4')]=_['defaults'](config[_0x04a9('0x4')],{'host':'localhost','port':0x18eb});var socket=require(_0x04a9('0x5'))(new Redis(config['redis']));require(_0x04a9('0x6'))[_0x04a9('0x7')](socket);function respondWithResult(_0x171db1,_0xeb2c83){_0xeb2c83=_0xeb2c83||0xc8;return function(_0x2380b0){if(_0x2380b0){return _0x171db1[_0x04a9('0x8')](_0xeb2c83)[_0x04a9('0x9')](_0x2380b0);}};}function respondWithFilteredResult(_0x417ab9,_0x31f311){return function(_0x57aba3){if(_0x57aba3){var _0x125f68=typeof _0x31f311[_0x04a9('0xa')]===_0x04a9('0xb')&&typeof _0x31f311['limit']===_0x04a9('0xb');var _0x1a1ca9=_0x57aba3[_0x04a9('0xc')];var _0x3774fa=_0x125f68?0x0:_0x31f311[_0x04a9('0xa')];var _0x2e586d=_0x125f68?_0x57aba3[_0x04a9('0xc')]:_0x31f311[_0x04a9('0xa')]+_0x31f311[_0x04a9('0xd')];var _0x423501;if(_0x2e586d>=_0x1a1ca9){_0x2e586d=_0x1a1ca9;_0x423501=0xc8;}else{_0x423501=0xce;}_0x417ab9['status'](_0x423501);return _0x417ab9[_0x04a9('0xe')](_0x04a9('0xf'),_0x3774fa+'-'+_0x2e586d+'/'+_0x1a1ca9)[_0x04a9('0x9')](_0x57aba3);}return null;};}function saveUpdates(_0x9f2237){return function(_0x329555){if(_0x329555){return _0x329555[_0x04a9('0x10')](_0x9f2237)[_0x04a9('0x11')](function(_0x2fe8f8){return _0x2fe8f8;});}return null;};}function removeEntity(_0x4f4f7b){return function(_0x489480){if(_0x489480){return _0x489480[_0x04a9('0x12')]()[_0x04a9('0x11')](function(){var _0x3959c1=_0x489480[_0x04a9('0x13')]({'plain':!![]});var _0x21d78e=_0x04a9('0x14');return db['UserProfileResource']['destroy']({'where':{'type':_0x21d78e,'resourceId':_0x3959c1['id']}})[_0x04a9('0x11')](function(){return _0x489480;});})[_0x04a9('0x11')](function(){var _0x5268ff=new Redis(config[_0x04a9('0x4')]);_0x5268ff[_0x04a9('0x15')]('agi',JSON[_0x04a9('0x16')]({'id':_0x489480['id'],'deleted':!![]}));})[_0x04a9('0x11')](function(){_0x4f4f7b[_0x04a9('0x8')](0xcc)[_0x04a9('0x17')]();});}};}function handleEntityNotFound(_0x54224d){return function(_0x3e8bca){if(!_0x3e8bca){_0x54224d[_0x04a9('0x18')](0x194);}return _0x3e8bca;};}function handleError(_0x1def95,_0x3c2b60){_0x3c2b60=_0x3c2b60||0x1f4;return function(_0x1fda54){logger[_0x04a9('0x19')](_0x1fda54[_0x04a9('0x1a')]);if(_0x1fda54[_0x04a9('0x1b')]){delete _0x1fda54[_0x04a9('0x1b')];}_0x1def95[_0x04a9('0x8')](_0x3c2b60)[_0x04a9('0x1c')](_0x1fda54);};}exports['index']=function(_0x3e33b0,_0x1ea50a){var _0x18febf={},_0x4fbfea={},_0x24d176={'count':0x0,'rows':[]};var _0x575d6b=_['map'](db[_0x04a9('0x1d')][_0x04a9('0x1e')],function(_0x5b7ff7){return{'name':_0x5b7ff7['fieldName'],'type':_0x5b7ff7[_0x04a9('0x1f')]['key']};});_0x4fbfea[_0x04a9('0x20')]=_['map'](_0x575d6b,_0x04a9('0x1b'));_0x4fbfea[_0x04a9('0x21')]=_['keys'](_0x3e33b0[_0x04a9('0x21')]);_0x4fbfea['filters']=_[_0x04a9('0x22')](_0x4fbfea['model'],_0x4fbfea[_0x04a9('0x21')]);_0x18febf[_0x04a9('0x23')]=_[_0x04a9('0x22')](_0x4fbfea[_0x04a9('0x20')],qs[_0x04a9('0x24')](_0x3e33b0[_0x04a9('0x21')][_0x04a9('0x24')]));_0x18febf[_0x04a9('0x23')]=_0x18febf[_0x04a9('0x23')]['length']?_0x18febf[_0x04a9('0x23')]:_0x4fbfea[_0x04a9('0x20')];if(!_0x3e33b0['query'][_0x04a9('0x25')](_0x04a9('0x26'))){_0x18febf[_0x04a9('0xd')]=qs[_0x04a9('0xd')](_0x3e33b0['query']['limit']);_0x18febf[_0x04a9('0xa')]=qs['offset'](_0x3e33b0['query']['offset']);}_0x18febf[_0x04a9('0x27')]=qs[_0x04a9('0x28')](_0x3e33b0[_0x04a9('0x21')]['sort']);_0x18febf[_0x04a9('0x29')]=qs[_0x04a9('0x2a')](_['pick'](_0x3e33b0['query'],_0x4fbfea[_0x04a9('0x2a')]),_0x575d6b);if(_0x3e33b0[_0x04a9('0x21')]['filter']){_0x18febf[_0x04a9('0x29')]=_[_0x04a9('0x2b')](_0x18febf[_0x04a9('0x29')],{'$or':_[_0x04a9('0x2c')](_0x575d6b,function(_0x598c56){if(_0x598c56['type']!==_0x04a9('0x2d')){var _0x2f20e4={};_0x2f20e4[_0x598c56['name']]={'$like':'%'+_0x3e33b0['query'][_0x04a9('0x2e')]+'%'};return _0x2f20e4;}})});}_0x18febf=_[_0x04a9('0x2b')]({},_0x18febf,_0x3e33b0[_0x04a9('0x2f')]);var _0x308de7={'where':_0x18febf['where']};return db[_0x04a9('0x1d')][_0x04a9('0xc')](_0x308de7)['then'](function(_0x4ccee9){_0x24d176[_0x04a9('0xc')]=_0x4ccee9;if(_0x3e33b0['query'][_0x04a9('0x30')]){_0x18febf[_0x04a9('0x31')]=[{'all':!![]}];}return db[_0x04a9('0x1d')][_0x04a9('0x32')](_0x18febf);})['then'](function(_0x79c49b){_0x24d176[_0x04a9('0x33')]=_0x79c49b;return _0x24d176;})[_0x04a9('0x11')](respondWithFilteredResult(_0x1ea50a,_0x18febf))[_0x04a9('0x34')](handleError(_0x1ea50a,null));};exports[_0x04a9('0x35')]=function(_0x55961f,_0x3e4bc6){var _0xd708c9={'raw':![],'where':{'id':_0x55961f[_0x04a9('0x36')]['id']}},_0x29e91f={};_0x29e91f[_0x04a9('0x20')]=_[_0x04a9('0x37')](db[_0x04a9('0x1d')][_0x04a9('0x1e')]);_0x29e91f[_0x04a9('0x21')]=_[_0x04a9('0x37')](_0x55961f[_0x04a9('0x21')]);_0x29e91f[_0x04a9('0x2a')]=_['intersection'](_0x29e91f[_0x04a9('0x20')],_0x29e91f[_0x04a9('0x21')]);_0xd708c9[_0x04a9('0x23')]=_[_0x04a9('0x22')](_0x29e91f[_0x04a9('0x20')],qs[_0x04a9('0x24')](_0x55961f[_0x04a9('0x21')][_0x04a9('0x24')]));_0xd708c9['attributes']=_0xd708c9[_0x04a9('0x23')][_0x04a9('0x38')]?_0xd708c9[_0x04a9('0x23')]:_0x29e91f['model'];if(_0x55961f['query'][_0x04a9('0x30')]){_0xd708c9[_0x04a9('0x31')]=[{'all':!![]}];}_0xd708c9=_['merge']({},_0xd708c9,_0x55961f[_0x04a9('0x2f')]);return db['SquareProject'][_0x04a9('0x39')](_0xd708c9)['then'](handleEntityNotFound(_0x3e4bc6,null))[_0x04a9('0x11')](respondWithResult(_0x3e4bc6,null))[_0x04a9('0x34')](handleError(_0x3e4bc6,null));};exports['create']=function(_0x291ee8,_0x1cc56f){return db['SquareProject'][_0x04a9('0x3a')](_0x291ee8['body'],{})[_0x04a9('0x11')](function(_0xeaec5d){var _0x15339b=_0x291ee8[_0x04a9('0x3b')]['get']({'plain':!![]});if(!_0x15339b)throw new Error(_0x04a9('0x3c'));if(_0x15339b[_0x04a9('0x3d')]==='user'){var _0x8da26f=_0xeaec5d[_0x04a9('0x13')]({'plain':!![]});var _0x2f75ec='SquareProjects';return db[_0x04a9('0x3e')][_0x04a9('0x39')]({'where':{'name':_0x2f75ec,'userProfileId':_0x15339b[_0x04a9('0x3f')]},'raw':!![]})[_0x04a9('0x11')](function(_0x1a08b4){if(_0x1a08b4&&_0x1a08b4[_0x04a9('0x40')]===0x0){return db[_0x04a9('0x41')]['create']({'name':_0x8da26f[_0x04a9('0x1b')],'resourceId':_0x8da26f['id'],'type':_0x1a08b4[_0x04a9('0x1b')],'sectionId':_0x1a08b4['id']},{})['then'](function(){return _0xeaec5d;});}else{return _0xeaec5d;}})['catch'](function(_0x1a8183){logger[_0x04a9('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1a8183);throw _0x1a8183;});}return _0xeaec5d;})[_0x04a9('0x11')](respondWithResult(_0x1cc56f,0xc9))[_0x04a9('0x34')](handleError(_0x1cc56f,null));};exports['update']=function(_0x1a2804,_0x28696c){if(_0x1a2804[_0x04a9('0x42')]['id']){delete _0x1a2804[_0x04a9('0x42')]['id'];}return db[_0x04a9('0x1d')][_0x04a9('0x39')]({'where':{'id':_0x1a2804['params']['id']}})['then'](handleEntityNotFound(_0x28696c,null))['then'](saveUpdates(_0x1a2804[_0x04a9('0x42')],null))['then'](function(_0x777dfa){if(!_0x777dfa)return;var _0x362e3f=_0x777dfa['get']({'plain':!![]});return _0x362e3f;})[_0x04a9('0x11')](function(_0x57dee9){var _0x12d551=new Redis(config['redis']);_0x12d551[_0x04a9('0x15')](_0x04a9('0x43'),JSON['stringify'](_['pick'](_0x57dee9,['id',_0x04a9('0x1b'),_0x04a9('0x44')])));return _0x57dee9;})[_0x04a9('0x11')](respondWithResult(_0x28696c,null))['catch'](handleError(_0x28696c,null));};exports['destroy']=function(_0x202cf7,_0x368979){return db[_0x04a9('0x1d')][_0x04a9('0x39')]({'where':{'id':_0x202cf7[_0x04a9('0x36')]['id']}})[_0x04a9('0x11')](handleEntityNotFound(_0x368979,null))[_0x04a9('0x11')](removeEntity(_0x368979,null))['catch'](handleError(_0x368979,null));};
\ No newline at end of file