Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / api / variable / variable.controller.js
index 2b815cc..677362a 100644 (file)
@@ -1 +1 @@
-'use strict';const a836_0x4552=['map','6zBiWhi','keys','model','includeAll','update','user','get','sendStatus','status','4972SMUnIe','options','show','1cZMkux','UserProfileResource','error','nolimit','name','api','query','Content-Range','findOne','1MmNhkx','rawAttributes','where','156678JkUyXZ','autoAssociation','count','17737EqumaS','length','Variables','destroy','UserProfileSection','@components/parsers/qs','Unable\x20to\x20retrieve\x20the\x20current\x20user','194690PtZXZP','sort','params','limit','fieldName','filters','send','json','intersection','then','185382lQlnwA','body','2bHMoPB','86035QJParP','userProfileId','create','rows','2OsbVmz','offset','41837NPjDtg','fields','@utils/filter-attributes','set','pick','undefined','role','1DCDLLy','include','merge','lodash','@mysqldb','catch','end','Variable','stack','attributes'];const a836_0x4178=function(_0x127169,_0xee1881){_0x127169=_0x127169-0x128;let _0x4552ff=a836_0x4552[_0x127169];return _0x4552ff;};const a836_0x5a5373=a836_0x4178;(function(_0x3c238a,_0x420a14){const _0x2506b2=a836_0x4178;while(!![]){try{const _0x110847=parseInt(_0x2506b2(0x137))*-parseInt(_0x2506b2(0x154))+-parseInt(_0x2506b2(0x160))*-parseInt(_0x2506b2(0x133))+parseInt(_0x2506b2(0x14b))*-parseInt(_0x2506b2(0x166))+parseInt(_0x2506b2(0x163))*-parseInt(_0x2506b2(0x157))+parseInt(_0x2506b2(0x139))*-parseInt(_0x2506b2(0x132))+parseInt(_0x2506b2(0x130))+parseInt(_0x2506b2(0x140))*parseInt(_0x2506b2(0x16d));if(_0x110847===_0x420a14)break;else _0x3c238a['push'](_0x3c238a['shift']());}catch(_0x1511c4){_0x3c238a['push'](_0x3c238a['shift']());}}}(a836_0x4552,0x1ab4d));const _=require(a836_0x5a5373(0x143)),qs=require(a836_0x5a5373(0x16b)),logger=require('@config/logger')(a836_0x5a5373(0x15c)),{db}=require(a836_0x5a5373(0x144)),{filterAttributes}=require(a836_0x5a5373(0x13b));function respondWithResult(_0x158493,_0x2ef48b){return _0x2ef48b=_0x2ef48b||0xc8,function(_0x1efc65){const _0xda6178=a836_0x4178;if(_0x1efc65)return _0x158493[_0xda6178(0x153)](_0x2ef48b)[_0xda6178(0x12d)](_0x1efc65);};}function respondWithFilteredResult(_0x4df1bf,_0x5da655){return function(_0x58c26e){const _0x346dbe=a836_0x4178;if(_0x58c26e){const _0x4bc05d=_0x58c26e[_0x346dbe(0x165)],_0x160331=_0x5da655[_0x346dbe(0x138)];let _0xcf6d5f=_0x5da655[_0x346dbe(0x138)]+_0x5da655[_0x346dbe(0x129)],_0x16e367;return _0xcf6d5f>=_0x4bc05d?(_0xcf6d5f=_0x4bc05d,_0x16e367=0xc8):_0x16e367=0xce,_0x4df1bf[_0x346dbe(0x153)](_0x16e367),_0x4df1bf[_0x346dbe(0x13c)](_0x346dbe(0x15e),_0x160331+'-'+_0xcf6d5f+'/'+_0x4bc05d)['json'](_0x58c26e);}return null;};}function saveUpdates(_0x28c21c){return function(_0x2f9d19){const _0x1294f7=a836_0x4178;if(_0x2f9d19)return _0x2f9d19[_0x1294f7(0x14f)](_0x28c21c)['then'](function(_0x4b2ff8){return _0x4b2ff8;});return null;};}function removeEntity(_0x485b7d){return function(_0x2d4502){const _0x513617=a836_0x4178;if(_0x2d4502)return _0x2d4502['destroy']()[_0x513617(0x12f)](function(){const _0x16124c=_0x513617,_0x263154=_0x2d4502[_0x16124c(0x151)]({'plain':!![]}),_0x27f813=_0x16124c(0x168);return db['UserProfileResource']['destroy']({'where':{'type':_0x27f813,'resourceId':_0x263154['id']}})[_0x16124c(0x12f)](function(){return _0x2d4502;});})['then'](function(){const _0x4631b2=_0x513617;_0x485b7d[_0x4631b2(0x153)](0xcc)[_0x4631b2(0x146)]();});};}function handleEntityNotFound(_0x315866){return function(_0x42c270){const _0x3affa3=a836_0x4178;return!_0x42c270&&_0x315866[_0x3affa3(0x152)](0x194),_0x42c270;};}function handleError(_0x2cdfe7,_0x389c79){return _0x389c79=_0x389c79||0x1f4,function(_0x63895d){const _0x2de088=a836_0x4178;logger[_0x2de088(0x159)](_0x63895d[_0x2de088(0x148)]),_0x63895d['name']&&delete _0x63895d[_0x2de088(0x15b)],_0x2cdfe7['status'](_0x389c79)[_0x2de088(0x12c)](_0x63895d);};}exports['index']=function(_0x1a3967,_0x305a09){const _0x4aa553=a836_0x5a5373;let _0x46c5f5={};const _0x36f3b0={},_0x310e1b={'count':0x0,'rows':[]},_0x4f522a=_[_0x4aa553(0x14a)](db['Variable']['rawAttributes'],function(_0x1c8453){const _0x55538e=_0x4aa553;return{'name':_0x1c8453[_0x55538e(0x12a)],'type':_0x1c8453['type']['key']};});_0x36f3b0[_0x4aa553(0x14d)]=_['map'](_0x4f522a,_0x4aa553(0x15b)),_0x36f3b0[_0x4aa553(0x15d)]=_[_0x4aa553(0x14c)](_0x1a3967[_0x4aa553(0x15d)]),_0x36f3b0[_0x4aa553(0x12b)]=_[_0x4aa553(0x12e)](_0x36f3b0['model'],_0x36f3b0[_0x4aa553(0x15d)]),_0x46c5f5[_0x4aa553(0x149)]=_['intersection'](_0x36f3b0['model'],qs['fields'](_0x1a3967[_0x4aa553(0x15d)][_0x4aa553(0x13a)])),_0x46c5f5[_0x4aa553(0x149)]=_0x46c5f5['attributes'][_0x4aa553(0x167)]?_0x46c5f5[_0x4aa553(0x149)]:_0x36f3b0['model'];typeof _0x1a3967[_0x4aa553(0x15d)][_0x4aa553(0x15a)]===_0x4aa553(0x13e)&&(_0x46c5f5[_0x4aa553(0x129)]=qs[_0x4aa553(0x129)](_0x1a3967[_0x4aa553(0x15d)][_0x4aa553(0x129)]),_0x46c5f5['offset']=qs[_0x4aa553(0x138)](_0x1a3967[_0x4aa553(0x15d)][_0x4aa553(0x138)]));_0x46c5f5['order']=qs[_0x4aa553(0x16e)](_0x1a3967[_0x4aa553(0x15d)][_0x4aa553(0x16e)]),_0x46c5f5[_0x4aa553(0x162)]=qs[_0x4aa553(0x12b)](_[_0x4aa553(0x13d)](_0x1a3967[_0x4aa553(0x15d)],_0x36f3b0['filters']),_0x4f522a),_0x46c5f5=filterAttributes(_0x46c5f5,_0x1a3967[_0x4aa553(0x15d)]['filter'],_0x4f522a,_0x1a3967[_0x4aa553(0x155)]);const _0x2d89f8={'where':_0x46c5f5[_0x4aa553(0x162)]};return db['Variable']['count'](_0x2d89f8)['then'](function(_0x2c22ea){const _0x4a185d=_0x4aa553;return _0x310e1b[_0x4a185d(0x165)]=_0x2c22ea,_0x1a3967['query'][_0x4a185d(0x14e)]&&(_0x46c5f5['include']=[{'all':!![]}]),db[_0x4a185d(0x147)]['findAll'](_0x46c5f5);})[_0x4aa553(0x12f)](function(_0x4480b8){const _0x52c44f=_0x4aa553;return _0x310e1b[_0x52c44f(0x136)]=_0x4480b8,_0x310e1b;})[_0x4aa553(0x12f)](respondWithFilteredResult(_0x305a09,_0x46c5f5))['catch'](handleError(_0x305a09,null));},exports[a836_0x5a5373(0x156)]=function(_0x478633,_0x59b1bf){const _0x3d7a91=a836_0x5a5373;let _0x52146a={'raw':!![],'where':{'id':_0x478633[_0x3d7a91(0x128)]['id']}};const _0x484651={};return _0x484651['model']=_[_0x3d7a91(0x14c)](db[_0x3d7a91(0x147)][_0x3d7a91(0x161)]),_0x484651['query']=_[_0x3d7a91(0x14c)](_0x478633[_0x3d7a91(0x15d)]),_0x484651[_0x3d7a91(0x12b)]=_['intersection'](_0x484651['model'],_0x484651[_0x3d7a91(0x15d)]),_0x52146a[_0x3d7a91(0x149)]=_[_0x3d7a91(0x12e)](_0x484651[_0x3d7a91(0x14d)],qs[_0x3d7a91(0x13a)](_0x478633[_0x3d7a91(0x15d)][_0x3d7a91(0x13a)])),_0x52146a[_0x3d7a91(0x149)]=_0x52146a[_0x3d7a91(0x149)][_0x3d7a91(0x167)]?_0x52146a['attributes']:_0x484651[_0x3d7a91(0x14d)],_0x478633['query'][_0x3d7a91(0x14e)]&&(_0x52146a[_0x3d7a91(0x141)]=[{'all':!![]}]),_0x52146a=_[_0x3d7a91(0x142)]({},_0x52146a,_0x478633['options']),db[_0x3d7a91(0x147)]['findOne'](_0x52146a)[_0x3d7a91(0x12f)](handleEntityNotFound(_0x59b1bf,null))[_0x3d7a91(0x12f)](respondWithResult(_0x59b1bf,null))[_0x3d7a91(0x145)](handleError(_0x59b1bf,null));},exports[a836_0x5a5373(0x135)]=function(_0x45c116,_0x11b3f6){const _0x3dd38b=a836_0x5a5373;return db[_0x3dd38b(0x147)][_0x3dd38b(0x135)](_0x45c116[_0x3dd38b(0x131)],{})[_0x3dd38b(0x12f)](function(_0x11b7e8){const _0xd1fe5d=_0x3dd38b,_0x192f37=_0x45c116[_0xd1fe5d(0x150)][_0xd1fe5d(0x151)]({'plain':!![]});if(!_0x192f37)throw new Error(_0xd1fe5d(0x16c));if(_0x192f37[_0xd1fe5d(0x13f)]===_0xd1fe5d(0x150)){const _0x2f5c6f=_0x11b7e8[_0xd1fe5d(0x151)]({'plain':!![]}),_0x1d7706='Variables';return db[_0xd1fe5d(0x16a)][_0xd1fe5d(0x15f)]({'where':{'name':_0x1d7706,'userProfileId':_0x192f37[_0xd1fe5d(0x134)]},'raw':!![]})[_0xd1fe5d(0x12f)](function(_0x557e8c){const _0x313f57=_0xd1fe5d;return _0x557e8c&&_0x557e8c[_0x313f57(0x164)]===0x0?db[_0x313f57(0x158)][_0x313f57(0x135)]({'name':_0x2f5c6f[_0x313f57(0x15b)],'resourceId':_0x2f5c6f['id'],'type':_0x557e8c[_0x313f57(0x15b)],'sectionId':_0x557e8c['id']},{})[_0x313f57(0x12f)](function(){return _0x11b7e8;}):_0x11b7e8;})[_0xd1fe5d(0x145)](function(_0x31ff4b){const _0x4ced80=_0xd1fe5d;logger[_0x4ced80(0x159)]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31ff4b);throw _0x31ff4b;});}return _0x11b7e8;})[_0x3dd38b(0x12f)](respondWithResult(_0x11b3f6,0xc9))[_0x3dd38b(0x145)](handleError(_0x11b3f6,null));},exports[a836_0x5a5373(0x14f)]=function(_0x441f6f,_0x252284){const _0x5a83ba=a836_0x5a5373;return _0x441f6f['body']['id']&&delete _0x441f6f[_0x5a83ba(0x131)]['id'],db[_0x5a83ba(0x147)][_0x5a83ba(0x15f)]({'where':{'id':_0x441f6f[_0x5a83ba(0x128)]['id']}})[_0x5a83ba(0x12f)](handleEntityNotFound(_0x252284,null))[_0x5a83ba(0x12f)](saveUpdates(_0x441f6f[_0x5a83ba(0x131)],null))[_0x5a83ba(0x12f)](respondWithResult(_0x252284,null))[_0x5a83ba(0x145)](handleError(_0x252284,null));},exports[a836_0x5a5373(0x169)]=function(_0x1b7f23,_0x376508){const _0x1f4ff0=a836_0x5a5373;return db['Variable'][_0x1f4ff0(0x15f)]({'where':{'id':_0x1b7f23['params']['id']}})[_0x1f4ff0(0x12f)](handleEntityNotFound(_0x376508,null))['then'](removeEntity(_0x376508,null))[_0x1f4ff0(0x145)](handleError(_0x376508,null));};
\ No newline at end of file
+'use strict';const a840_0x1c58=['body','error','params','then','limit','include','fields','1DgaBAj','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unable\x20to\x20retrieve\x20the\x20current\x20user','526DVRuIZ','@utils/filter-attributes','sort','where','query','rows','create','offset','end','update','order','count','userProfileId','show','status','intersection','431qoAMjV','merge','95513ctZXrO','484359gWALFB','UserProfileSection','pick','282038zFxhbX','666FKvVGQ','set','Variables','includeAll','model','findOne','attributes','rawAttributes','map','destroy','json','70996mHULdE','lodash','@components/parsers/qs','filter','filters','length','undefined','994371MyJVkk','UserProfileResource','name','@mysqldb','options','1478FWOzfK','get','role','Variable','catch','send','keys'];const a840_0x149d=function(_0x995d7f,_0x2f8762){_0x995d7f=_0x995d7f-0x1e6;let _0x1c58bf=a840_0x1c58[_0x995d7f];return _0x1c58bf;};const a840_0x32e06a=a840_0x149d;(function(_0x4dec34,_0x8af26f){const _0x4d4de5=a840_0x149d;while(!![]){try{const _0x10fe5f=parseInt(_0x4d4de5(0x201))*-parseInt(_0x4d4de5(0x1ea))+parseInt(_0x4d4de5(0x212))*-parseInt(_0x4d4de5(0x222))+parseInt(_0x4d4de5(0x1e9))+-parseInt(_0x4d4de5(0x1f5))+parseInt(_0x4d4de5(0x1e6))+-parseInt(_0x4d4de5(0x20f))*-parseInt(_0x4d4de5(0x224))+parseInt(_0x4d4de5(0x1fc));if(_0x10fe5f===_0x8af26f)break;else _0x4dec34['push'](_0x4dec34['shift']());}catch(_0x3e6182){_0x4dec34['push'](_0x4dec34['shift']());}}}(a840_0x1c58,0x8c317));const _=require(a840_0x32e06a(0x1f6)),qs=require(a840_0x32e06a(0x1f7)),logger=require('@config/logger')('api'),{db}=require(a840_0x32e06a(0x1ff)),{filterAttributes}=require(a840_0x32e06a(0x213));function respondWithResult(_0x54dd5d,_0x29d091){return _0x29d091=_0x29d091||0xc8,function(_0x36bd07){const _0x50e5c6=a840_0x149d;if(_0x36bd07)return _0x54dd5d[_0x50e5c6(0x220)](_0x29d091)[_0x50e5c6(0x1f4)](_0x36bd07);};}function respondWithFilteredResult(_0x4d8a90,_0x10e71e){return function(_0x1ebe2e){const _0x300eed=a840_0x149d;if(_0x1ebe2e){const _0x89c0cb=_0x1ebe2e[_0x300eed(0x21d)],_0x35ded7=_0x10e71e[_0x300eed(0x219)];let _0x1d5b7e=_0x10e71e[_0x300eed(0x219)]+_0x10e71e['limit'],_0x126ef6;return _0x1d5b7e>=_0x89c0cb?(_0x1d5b7e=_0x89c0cb,_0x126ef6=0xc8):_0x126ef6=0xce,_0x4d8a90['status'](_0x126ef6),_0x4d8a90[_0x300eed(0x1eb)]('Content-Range',_0x35ded7+'-'+_0x1d5b7e+'/'+_0x89c0cb)[_0x300eed(0x1f4)](_0x1ebe2e);}return null;};}function saveUpdates(_0x21e324){return function(_0x3b7f95){const _0x290a49=a840_0x149d;if(_0x3b7f95)return _0x3b7f95[_0x290a49(0x21b)](_0x21e324)['then'](function(_0x30b5ee){return _0x30b5ee;});return null;};}function removeEntity(_0x36e5db){return function(_0x119ba2){const _0x430109=a840_0x149d;if(_0x119ba2)return _0x119ba2[_0x430109(0x1f3)]()[_0x430109(0x20b)](function(){const _0xbbd40f=_0x430109,_0x35c528=_0x119ba2[_0xbbd40f(0x202)]({'plain':!![]}),_0x336185='Variables';return db[_0xbbd40f(0x1fd)][_0xbbd40f(0x1f3)]({'where':{'type':_0x336185,'resourceId':_0x35c528['id']}})['then'](function(){return _0x119ba2;});})['then'](function(){const _0x1d1b03=_0x430109;_0x36e5db[_0x1d1b03(0x220)](0xcc)[_0x1d1b03(0x21a)]();});};}function handleEntityNotFound(_0x24831d){return function(_0xc3011f){return!_0xc3011f&&_0x24831d['sendStatus'](0x194),_0xc3011f;};}function handleError(_0x235691,_0x297566){return _0x297566=_0x297566||0x1f4,function(_0x19eb0a){const _0x471372=a840_0x149d;logger[_0x471372(0x209)](_0x19eb0a['stack']),_0x19eb0a[_0x471372(0x1fe)]&&delete _0x19eb0a['name'],_0x235691[_0x471372(0x220)](_0x297566)[_0x471372(0x206)](_0x19eb0a);};}exports['index']=function(_0x52fe33,_0x266e2b){const _0x50e97d=a840_0x32e06a;let _0x4b9abf={};const _0x52e40c={},_0x3a74c6={'count':0x0,'rows':[]},_0x57c598=_[_0x50e97d(0x1f2)](db[_0x50e97d(0x204)][_0x50e97d(0x1f1)],function(_0x1887ce){return{'name':_0x1887ce['fieldName'],'type':_0x1887ce['type']['key']};});_0x52e40c[_0x50e97d(0x1ee)]=_[_0x50e97d(0x1f2)](_0x57c598,_0x50e97d(0x1fe)),_0x52e40c['query']=_['keys'](_0x52fe33[_0x50e97d(0x216)]),_0x52e40c[_0x50e97d(0x1f9)]=_[_0x50e97d(0x221)](_0x52e40c[_0x50e97d(0x1ee)],_0x52e40c['query']),_0x4b9abf[_0x50e97d(0x1f0)]=_[_0x50e97d(0x221)](_0x52e40c[_0x50e97d(0x1ee)],qs[_0x50e97d(0x20e)](_0x52fe33[_0x50e97d(0x216)][_0x50e97d(0x20e)])),_0x4b9abf[_0x50e97d(0x1f0)]=_0x4b9abf['attributes'][_0x50e97d(0x1fa)]?_0x4b9abf[_0x50e97d(0x1f0)]:_0x52e40c[_0x50e97d(0x1ee)];typeof _0x52fe33[_0x50e97d(0x216)]['nolimit']===_0x50e97d(0x1fb)&&(_0x4b9abf[_0x50e97d(0x20c)]=qs[_0x50e97d(0x20c)](_0x52fe33[_0x50e97d(0x216)][_0x50e97d(0x20c)]),_0x4b9abf[_0x50e97d(0x219)]=qs[_0x50e97d(0x219)](_0x52fe33[_0x50e97d(0x216)]['offset']));_0x4b9abf[_0x50e97d(0x21c)]=qs['sort'](_0x52fe33[_0x50e97d(0x216)][_0x50e97d(0x214)]),_0x4b9abf[_0x50e97d(0x215)]=qs[_0x50e97d(0x1f9)](_[_0x50e97d(0x1e8)](_0x52fe33['query'],_0x52e40c['filters']),_0x57c598),_0x4b9abf=filterAttributes(_0x4b9abf,_0x52fe33[_0x50e97d(0x216)][_0x50e97d(0x1f8)],_0x57c598,_0x52fe33['options']);const _0x473226={'where':_0x4b9abf[_0x50e97d(0x215)]};return db[_0x50e97d(0x204)][_0x50e97d(0x21d)](_0x473226)[_0x50e97d(0x20b)](function(_0x49ed37){const _0x5ca820=_0x50e97d;return _0x3a74c6['count']=_0x49ed37,_0x52fe33[_0x5ca820(0x216)][_0x5ca820(0x1ed)]&&(_0x4b9abf[_0x5ca820(0x20d)]=[{'all':!![]}]),db[_0x5ca820(0x204)]['findAll'](_0x4b9abf);})[_0x50e97d(0x20b)](function(_0x15a387){const _0x32db13=_0x50e97d;return _0x3a74c6[_0x32db13(0x217)]=_0x15a387,_0x3a74c6;})[_0x50e97d(0x20b)](respondWithFilteredResult(_0x266e2b,_0x4b9abf))[_0x50e97d(0x205)](handleError(_0x266e2b,null));},exports[a840_0x32e06a(0x21f)]=function(_0x37c99f,_0x280483){const _0x24e405=a840_0x32e06a;let _0x3730fb={'raw':!![],'where':{'id':_0x37c99f[_0x24e405(0x20a)]['id']}};const _0x38a840={};return _0x38a840[_0x24e405(0x1ee)]=_[_0x24e405(0x207)](db[_0x24e405(0x204)][_0x24e405(0x1f1)]),_0x38a840[_0x24e405(0x216)]=_[_0x24e405(0x207)](_0x37c99f[_0x24e405(0x216)]),_0x38a840[_0x24e405(0x1f9)]=_['intersection'](_0x38a840[_0x24e405(0x1ee)],_0x38a840['query']),_0x3730fb[_0x24e405(0x1f0)]=_[_0x24e405(0x221)](_0x38a840[_0x24e405(0x1ee)],qs[_0x24e405(0x20e)](_0x37c99f[_0x24e405(0x216)][_0x24e405(0x20e)])),_0x3730fb[_0x24e405(0x1f0)]=_0x3730fb[_0x24e405(0x1f0)][_0x24e405(0x1fa)]?_0x3730fb[_0x24e405(0x1f0)]:_0x38a840['model'],_0x37c99f[_0x24e405(0x216)][_0x24e405(0x1ed)]&&(_0x3730fb[_0x24e405(0x20d)]=[{'all':!![]}]),_0x3730fb=_[_0x24e405(0x223)]({},_0x3730fb,_0x37c99f[_0x24e405(0x200)]),db[_0x24e405(0x204)][_0x24e405(0x1ef)](_0x3730fb)[_0x24e405(0x20b)](handleEntityNotFound(_0x280483,null))[_0x24e405(0x20b)](respondWithResult(_0x280483,null))[_0x24e405(0x205)](handleError(_0x280483,null));},exports[a840_0x32e06a(0x218)]=function(_0x1dea2e,_0x548647){const _0x1a36ed=a840_0x32e06a;return db[_0x1a36ed(0x204)][_0x1a36ed(0x218)](_0x1dea2e[_0x1a36ed(0x208)],{})['then'](function(_0x2d4203){const _0x3bef47=_0x1a36ed,_0x23cc34=_0x1dea2e['user'][_0x3bef47(0x202)]({'plain':!![]});if(!_0x23cc34)throw new Error(_0x3bef47(0x211));if(_0x23cc34[_0x3bef47(0x203)]==='user'){const _0x4e51bf=_0x2d4203[_0x3bef47(0x202)]({'plain':!![]}),_0x34ce8b=_0x3bef47(0x1ec);return db[_0x3bef47(0x1e7)][_0x3bef47(0x1ef)]({'where':{'name':_0x34ce8b,'userProfileId':_0x23cc34[_0x3bef47(0x21e)]},'raw':!![]})['then'](function(_0x211c55){const _0xd5ef4a=_0x3bef47;return _0x211c55&&_0x211c55['autoAssociation']===0x0?db[_0xd5ef4a(0x1fd)]['create']({'name':_0x4e51bf['name'],'resourceId':_0x4e51bf['id'],'type':_0x211c55[_0xd5ef4a(0x1fe)],'sectionId':_0x211c55['id']},{})[_0xd5ef4a(0x20b)](function(){return _0x2d4203;}):_0x2d4203;})[_0x3bef47(0x205)](function(_0x3bdf2){const _0x1e73b8=_0x3bef47;logger[_0x1e73b8(0x209)](_0x1e73b8(0x210),_0x3bdf2);throw _0x3bdf2;});}return _0x2d4203;})[_0x1a36ed(0x20b)](respondWithResult(_0x548647,0xc9))['catch'](handleError(_0x548647,null));},exports[a840_0x32e06a(0x21b)]=function(_0x30736f,_0x5466ac){const _0x21565a=a840_0x32e06a;return _0x30736f['body']['id']&&delete _0x30736f['body']['id'],db[_0x21565a(0x204)]['findOne']({'where':{'id':_0x30736f['params']['id']}})[_0x21565a(0x20b)](handleEntityNotFound(_0x5466ac,null))[_0x21565a(0x20b)](saveUpdates(_0x30736f['body'],null))[_0x21565a(0x20b)](respondWithResult(_0x5466ac,null))[_0x21565a(0x205)](handleError(_0x5466ac,null));},exports['destroy']=function(_0x4bff9c,_0x241b9a){const _0x3c8998=a840_0x32e06a;return db[_0x3c8998(0x204)][_0x3c8998(0x1ef)]({'where':{'id':_0x4bff9c[_0x3c8998(0x20a)]['id']}})['then'](handleEntityNotFound(_0x241b9a,null))[_0x3c8998(0x20b)](removeEntity(_0x241b9a,null))[_0x3c8998(0x205)](handleError(_0x241b9a,null));};
\ No newline at end of file