Built motion from commit f738f9592c388b9f9eb3948f400a5c9d717a3561. Version 3.0.0...
[motion-next.git] / server / api / pause / pause.controller.js
index c155628..be53d57 100644 (file)
@@ -1 +1 @@
-const a612_0x206b=['sort','rawAttributes','key','update','includeAll','api','filters','include','findOne','../../config/logger','map','filter','Pauses','index','json','UserProfileSection','length','limit','offset','undefined','VIRTUAL','merge','end','fieldName','intersection','rows','status','body','type','show','get','UserProfileResource','lodash','name','then','options','Unable\x20to\x20retrieve\x20the\x20current\x20user','where','error','Content-Range','user','query','create','attributes','findAll','stack','model','keys','like','catch','Pause','nolimit','../../components/parsers/qs','count','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','sequelize','fields','set','params','sendStatus','pick','order','role'];(function(_0x1969a1,_0x10f0eb){const _0x206b84=function(_0x349f31){while(--_0x349f31){_0x1969a1['push'](_0x1969a1['shift']());}};_0x206b84(++_0x10f0eb);}(a612_0x206b,0x138));const a612_0x349f=function(_0x1969a1,_0x10f0eb){_0x1969a1=_0x1969a1-0xf1;let _0x206b84=a612_0x206b[_0x1969a1];return _0x206b84;};const a612_0x53cd9f=a612_0x349f;'use strict';const _=require(a612_0x53cd9f(0x119)),qs=require(a612_0x53cd9f(0x12d)),logger=require(a612_0x53cd9f(0x102))(a612_0x53cd9f(0xfe)),{db}=require('../../mysqldb'),{Op}=require(a612_0x53cd9f(0xf1));function respondWithResult(_0x528d63,_0x5aa66b){return _0x5aa66b=_0x5aa66b||0xc8,function(_0x6758b5){const _0x505abe=a612_0x349f;if(_0x6758b5)return _0x528d63[_0x505abe(0x113)](_0x5aa66b)[_0x505abe(0x107)](_0x6758b5);};}function respondWithFilteredResult(_0x4cda04,_0x1f89c3){return function(_0x27021a){const _0x58ca99=a612_0x349f;if(_0x27021a){const _0x253d69=_0x27021a['count'],_0x334119=_0x1f89c3['offset'];let _0x513a10=_0x1f89c3[_0x58ca99(0x10b)]+_0x1f89c3[_0x58ca99(0x10a)],_0x1a92e0;return _0x513a10>=_0x253d69?(_0x513a10=_0x253d69,_0x1a92e0=0xc8):_0x1a92e0=0xce,_0x4cda04[_0x58ca99(0x113)](_0x1a92e0),_0x4cda04[_0x58ca99(0xf3)](_0x58ca99(0x120),_0x334119+'-'+_0x513a10+'/'+_0x253d69)[_0x58ca99(0x107)](_0x27021a);}return null;};}function saveUpdates(_0x231e38){return function(_0x5b67b2){const _0x5c5d9f=a612_0x349f;if(_0x5b67b2)return _0x5b67b2[_0x5c5d9f(0xfc)](_0x231e38)[_0x5c5d9f(0x11b)](function(_0x12ad0b){return _0x12ad0b;});return null;};}function removeEntity(_0x24fbef){return function(_0x1f8966){const _0x74a319=a612_0x349f;if(_0x1f8966)return _0x1f8966['destroy']()[_0x74a319(0x11b)](function(){const _0x405293=_0x74a319,_0x62dc74=_0x1f8966[_0x405293(0x117)]({'plain':!![]}),_0x1f4709='Pauses';return db[_0x405293(0x118)]['destroy']({'where':{'type':_0x1f4709,'resourceId':_0x62dc74['id']}})[_0x405293(0x11b)](function(){return _0x1f8966;});})[_0x74a319(0x11b)](function(){const _0x406710=_0x74a319;_0x24fbef[_0x406710(0x113)](0xcc)[_0x406710(0x10f)]();});};}function handleEntityNotFound(_0x241100){return function(_0x28f653){const _0x408ba6=a612_0x349f;return!_0x28f653&&_0x241100[_0x408ba6(0xf5)](0x194),_0x28f653;};}function handleError(_0x6188d9,_0x4e2198){return _0x4e2198=_0x4e2198||0x1f4,function(_0x358f07){const _0x3e0fee=a612_0x349f;logger[_0x3e0fee(0x11f)](_0x358f07[_0x3e0fee(0x126)]),_0x358f07[_0x3e0fee(0x11a)]&&delete _0x358f07[_0x3e0fee(0x11a)],_0x6188d9[_0x3e0fee(0x113)](_0x4e2198)[_0x3e0fee(0x130)](_0x358f07);};}exports[a612_0x53cd9f(0x106)]=function(_0x37cc59,_0x35592e){const _0x41fba8=a612_0x53cd9f;let _0x1ba992={};const _0x5153e1={},_0x7fd17d={'count':0x0,'rows':[]},_0x50772c=_[_0x41fba8(0x103)](db[_0x41fba8(0x12b)][_0x41fba8(0xfa)],function(_0x44302f){const _0x34c0bc=_0x41fba8;return{'name':_0x44302f[_0x34c0bc(0x110)],'type':_0x44302f[_0x34c0bc(0x115)][_0x34c0bc(0xfb)]};});_0x5153e1['model']=_[_0x41fba8(0x103)](_0x50772c,_0x41fba8(0x11a)),_0x5153e1[_0x41fba8(0x122)]=_[_0x41fba8(0x128)](_0x37cc59['query']),_0x5153e1[_0x41fba8(0xff)]=_[_0x41fba8(0x111)](_0x5153e1[_0x41fba8(0x127)],_0x5153e1['query']),_0x1ba992[_0x41fba8(0x124)]=_[_0x41fba8(0x111)](_0x5153e1[_0x41fba8(0x127)],qs['fields'](_0x37cc59[_0x41fba8(0x122)][_0x41fba8(0xf2)])),_0x1ba992[_0x41fba8(0x124)]=_0x1ba992[_0x41fba8(0x124)][_0x41fba8(0x109)]?_0x1ba992['attributes']:_0x5153e1[_0x41fba8(0x127)];typeof _0x37cc59[_0x41fba8(0x122)][_0x41fba8(0x12c)]===_0x41fba8(0x10c)&&(_0x1ba992[_0x41fba8(0x10a)]=qs[_0x41fba8(0x10a)](_0x37cc59[_0x41fba8(0x122)][_0x41fba8(0x10a)]),_0x1ba992['offset']=qs[_0x41fba8(0x10b)](_0x37cc59[_0x41fba8(0x122)][_0x41fba8(0x10b)]));_0x1ba992[_0x41fba8(0xf7)]=qs['sort'](_0x37cc59[_0x41fba8(0x122)][_0x41fba8(0xf9)]),_0x1ba992[_0x41fba8(0x11e)]=qs[_0x41fba8(0xff)](_[_0x41fba8(0xf6)](_0x37cc59[_0x41fba8(0x122)],_0x5153e1[_0x41fba8(0xff)]),_0x50772c);_0x37cc59[_0x41fba8(0x122)][_0x41fba8(0x104)]&&(_0x1ba992['where']=_[_0x41fba8(0x10e)](_0x1ba992['where'],{[Op['or']]:_[_0x41fba8(0x103)](_0x50772c,function(_0x1b093a){const _0x24a35c=_0x41fba8;if(_0x1b093a[_0x24a35c(0x115)]!==_0x24a35c(0x10d)){const _0x9258e9={};return _0x9258e9[_0x1b093a[_0x24a35c(0x11a)]]={[Op[_0x24a35c(0x129)]]:'%'+_0x37cc59['query'][_0x24a35c(0x104)]+'%'},_0x9258e9;}})}));_0x1ba992=_[_0x41fba8(0x10e)]({},_0x1ba992,_0x37cc59[_0x41fba8(0x11c)]);const _0x559ee9={'where':_0x1ba992[_0x41fba8(0x11e)]};return db[_0x41fba8(0x12b)][_0x41fba8(0x12e)](_0x559ee9)['then'](function(_0x3bb59f){const _0x380951=_0x41fba8;return _0x7fd17d[_0x380951(0x12e)]=_0x3bb59f,_0x37cc59[_0x380951(0x122)]['includeAll']&&(_0x1ba992[_0x380951(0x100)]=[{'all':!![]}]),db[_0x380951(0x12b)][_0x380951(0x125)](_0x1ba992);})['then'](function(_0x177bf4){const _0x58055c=_0x41fba8;return _0x7fd17d[_0x58055c(0x112)]=_0x177bf4,_0x7fd17d;})['then'](respondWithFilteredResult(_0x35592e,_0x1ba992))['catch'](handleError(_0x35592e,null));},exports[a612_0x53cd9f(0x116)]=function(_0x3c2903,_0x2967a6){const _0x4f6488=a612_0x53cd9f;let _0x44fe7e={'raw':!![],'where':{'id':_0x3c2903[_0x4f6488(0xf4)]['id']}};const _0xd881d7={};return _0xd881d7[_0x4f6488(0x127)]=_[_0x4f6488(0x128)](db[_0x4f6488(0x12b)][_0x4f6488(0xfa)]),_0xd881d7[_0x4f6488(0x122)]=_[_0x4f6488(0x128)](_0x3c2903[_0x4f6488(0x122)]),_0xd881d7[_0x4f6488(0xff)]=_[_0x4f6488(0x111)](_0xd881d7[_0x4f6488(0x127)],_0xd881d7[_0x4f6488(0x122)]),_0x44fe7e[_0x4f6488(0x124)]=_[_0x4f6488(0x111)](_0xd881d7[_0x4f6488(0x127)],qs['fields'](_0x3c2903[_0x4f6488(0x122)][_0x4f6488(0xf2)])),_0x44fe7e[_0x4f6488(0x124)]=_0x44fe7e[_0x4f6488(0x124)]['length']?_0x44fe7e['attributes']:_0xd881d7[_0x4f6488(0x127)],_0x3c2903[_0x4f6488(0x122)][_0x4f6488(0xfd)]&&(_0x44fe7e[_0x4f6488(0x100)]=[{'all':!![]}]),_0x44fe7e=_[_0x4f6488(0x10e)]({},_0x44fe7e,_0x3c2903['options']),db[_0x4f6488(0x12b)][_0x4f6488(0x101)](_0x44fe7e)[_0x4f6488(0x11b)](handleEntityNotFound(_0x2967a6,null))[_0x4f6488(0x11b)](respondWithResult(_0x2967a6,null))[_0x4f6488(0x12a)](handleError(_0x2967a6,null));},exports[a612_0x53cd9f(0x123)]=function(_0x5e640e,_0x516208){const _0x474aea=a612_0x53cd9f;return db[_0x474aea(0x12b)][_0x474aea(0x123)](_0x5e640e[_0x474aea(0x114)],{})[_0x474aea(0x11b)](function(_0x2cd6af){const _0x50ffbb=_0x474aea,_0x18bb34=_0x5e640e[_0x50ffbb(0x121)][_0x50ffbb(0x117)]({'plain':!![]});if(!_0x18bb34)throw new Error(_0x50ffbb(0x11d));if(_0x18bb34[_0x50ffbb(0xf8)]==='user'){const _0x4d39af=_0x2cd6af[_0x50ffbb(0x117)]({'plain':!![]}),_0x32ef0c=_0x50ffbb(0x105);return db[_0x50ffbb(0x108)]['findOne']({'where':{'name':_0x32ef0c,'userProfileId':_0x18bb34['userProfileId']},'raw':!![]})[_0x50ffbb(0x11b)](function(_0x519ccd){const _0x2e32f4=_0x50ffbb;return _0x519ccd&&_0x519ccd['autoAssociation']===0x0?db[_0x2e32f4(0x118)][_0x2e32f4(0x123)]({'name':_0x4d39af[_0x2e32f4(0x11a)],'resourceId':_0x4d39af['id'],'type':_0x519ccd[_0x2e32f4(0x11a)],'sectionId':_0x519ccd['id']},{})['then'](function(){return _0x2cd6af;}):_0x2cd6af;})[_0x50ffbb(0x12a)](function(_0x46b5b3){const _0x5a06ea=_0x50ffbb;logger[_0x5a06ea(0x11f)](_0x5a06ea(0x12f),_0x46b5b3);throw _0x46b5b3;});}return _0x2cd6af;})[_0x474aea(0x11b)](respondWithResult(_0x516208,0xc9))[_0x474aea(0x12a)](handleError(_0x516208,null));},exports[a612_0x53cd9f(0xfc)]=function(_0x2d6aef,_0x442375){const _0x4bb0f7=a612_0x53cd9f;return _0x2d6aef[_0x4bb0f7(0x114)]['id']&&delete _0x2d6aef['body']['id'],db[_0x4bb0f7(0x12b)][_0x4bb0f7(0x101)]({'where':{'id':_0x2d6aef['params']['id']}})[_0x4bb0f7(0x11b)](handleEntityNotFound(_0x442375,null))['then'](saveUpdates(_0x2d6aef['body'],null))[_0x4bb0f7(0x11b)](respondWithResult(_0x442375,null))[_0x4bb0f7(0x12a)](handleError(_0x442375,null));},exports['destroy']=function(_0x253fa8,_0x59a111){const _0x3040d1=a612_0x53cd9f;return db['Pause'][_0x3040d1(0x101)]({'where':{'id':_0x253fa8[_0x3040d1(0xf4)]['id']}})[_0x3040d1(0x11b)](handleEntityNotFound(_0x59a111,null))[_0x3040d1(0x11b)](removeEntity(_0x59a111,null))[_0x3040d1(0x12a)](handleError(_0x59a111,null));};
\ No newline at end of file
+const a612_0x58b6=['where','findAll','UserProfileSection','intersection','pick','filters','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','VIRTUAL','model','includeAll','merge','autoAssociation','nolimit','../../config/logger','like','include','filter','Pause','index','rawAttributes','offset','api','limit','map','fields','UserProfileResource','body','query','then','get','catch','role','options','type','show','end','destroy','user','sendStatus','length','keys','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','../../mysqldb','rows','sort','name','Content-Range','fieldName','lodash','set','sequelize','Pauses','attributes','json','findOne','../../components/parsers/qs','params','update','count','create','order','status','userProfileId'];(function(_0x5d0e29,_0x2cf489){const _0x58b60c=function(_0x4f270e){while(--_0x4f270e){_0x5d0e29['push'](_0x5d0e29['shift']());}};_0x58b60c(++_0x2cf489);}(a612_0x58b6,0x165));const a612_0x4f27=function(_0x5d0e29,_0x2cf489){_0x5d0e29=_0x5d0e29-0x144;let _0x58b60c=a612_0x58b6[_0x5d0e29];return _0x58b60c;};const a612_0x4365d3=a612_0x4f27;'use strict';const _=require(a612_0x4365d3(0x150)),qs=require(a612_0x4365d3(0x157)),logger=require(a612_0x4365d3(0x16d))(a612_0x4365d3(0x175)),{db}=require(a612_0x4365d3(0x14a)),{Op}=require(a612_0x4365d3(0x152));function respondWithResult(_0x22cbfe,_0x596ab5){return _0x596ab5=_0x596ab5||0xc8,function(_0x190287){const _0x1f27b6=a612_0x4f27;if(_0x190287)return _0x22cbfe[_0x1f27b6(0x15d)](_0x596ab5)['json'](_0x190287);};}function respondWithFilteredResult(_0x578b56,_0x1444a4){return function(_0x4a17fd){const _0x11975e=a612_0x4f27;if(_0x4a17fd){const _0x486abf=_0x4a17fd[_0x11975e(0x15a)],_0xbac113=_0x1444a4[_0x11975e(0x174)];let _0x2093ae=_0x1444a4[_0x11975e(0x174)]+_0x1444a4[_0x11975e(0x176)],_0x42ae05;return _0x2093ae>=_0x486abf?(_0x2093ae=_0x486abf,_0x42ae05=0xc8):_0x42ae05=0xce,_0x578b56['status'](_0x42ae05),_0x578b56[_0x11975e(0x151)](_0x11975e(0x14e),_0xbac113+'-'+_0x2093ae+'/'+_0x486abf)[_0x11975e(0x155)](_0x4a17fd);}return null;};}function saveUpdates(_0x18d254){return function(_0x5bd4b1){const _0x308879=a612_0x4f27;if(_0x5bd4b1)return _0x5bd4b1[_0x308879(0x159)](_0x18d254)['then'](function(_0x3edf5f){return _0x3edf5f;});return null;};}function removeEntity(_0x4125fd){return function(_0x43980c){const _0x3ed27e=a612_0x4f27;if(_0x43980c)return _0x43980c[_0x3ed27e(0x144)]()[_0x3ed27e(0x17c)](function(){const _0x57fbcf=_0x3ed27e,_0x360f94=_0x43980c[_0x57fbcf(0x17d)]({'plain':!![]}),_0x2856af='Pauses';return db['UserProfileResource'][_0x57fbcf(0x144)]({'where':{'type':_0x2856af,'resourceId':_0x360f94['id']}})[_0x57fbcf(0x17c)](function(){return _0x43980c;});})['then'](function(){const _0x973c68=_0x3ed27e;_0x4125fd[_0x973c68(0x15d)](0xcc)[_0x973c68(0x183)]();});};}function handleEntityNotFound(_0x2ea985){return function(_0x1707c7){const _0x46432f=a612_0x4f27;return!_0x1707c7&&_0x2ea985[_0x46432f(0x146)](0x194),_0x1707c7;};}function handleError(_0x9761d5,_0xd0c6f9){return _0xd0c6f9=_0xd0c6f9||0x1f4,function(_0x4f531a){const _0x1c45c0=a612_0x4f27;logger[_0x1c45c0(0x166)](_0x4f531a['stack']),_0x4f531a[_0x1c45c0(0x14d)]&&delete _0x4f531a[_0x1c45c0(0x14d)],_0x9761d5[_0x1c45c0(0x15d)](_0xd0c6f9)['send'](_0x4f531a);};}exports[a612_0x4365d3(0x172)]=function(_0xe0547a,_0x5e52de){const _0x327b5f=a612_0x4365d3;let _0x2008a8={};const _0x348ae2={},_0x1aabd6={'count':0x0,'rows':[]},_0x161d73=_[_0x327b5f(0x177)](db[_0x327b5f(0x171)][_0x327b5f(0x173)],function(_0x4f0bbb){const _0x174049=_0x327b5f;return{'name':_0x4f0bbb[_0x174049(0x14f)],'type':_0x4f0bbb[_0x174049(0x181)]['key']};});_0x348ae2[_0x327b5f(0x168)]=_['map'](_0x161d73,_0x327b5f(0x14d)),_0x348ae2[_0x327b5f(0x17b)]=_[_0x327b5f(0x148)](_0xe0547a['query']),_0x348ae2[_0x327b5f(0x164)]=_[_0x327b5f(0x162)](_0x348ae2[_0x327b5f(0x168)],_0x348ae2['query']),_0x2008a8[_0x327b5f(0x154)]=_[_0x327b5f(0x162)](_0x348ae2['model'],qs[_0x327b5f(0x178)](_0xe0547a[_0x327b5f(0x17b)][_0x327b5f(0x178)])),_0x2008a8[_0x327b5f(0x154)]=_0x2008a8['attributes']['length']?_0x2008a8['attributes']:_0x348ae2[_0x327b5f(0x168)];typeof _0xe0547a[_0x327b5f(0x17b)][_0x327b5f(0x16c)]==='undefined'&&(_0x2008a8[_0x327b5f(0x176)]=qs[_0x327b5f(0x176)](_0xe0547a['query']['limit']),_0x2008a8['offset']=qs[_0x327b5f(0x174)](_0xe0547a[_0x327b5f(0x17b)][_0x327b5f(0x174)]));_0x2008a8[_0x327b5f(0x15c)]=qs[_0x327b5f(0x14c)](_0xe0547a[_0x327b5f(0x17b)]['sort']),_0x2008a8[_0x327b5f(0x15f)]=qs[_0x327b5f(0x164)](_[_0x327b5f(0x163)](_0xe0547a[_0x327b5f(0x17b)],_0x348ae2[_0x327b5f(0x164)]),_0x161d73);_0xe0547a[_0x327b5f(0x17b)][_0x327b5f(0x170)]&&(_0x2008a8['where']=_['merge'](_0x2008a8[_0x327b5f(0x15f)],{[Op['or']]:_['map'](_0x161d73,function(_0x9ab525){const _0x599c28=_0x327b5f;if(_0x9ab525[_0x599c28(0x181)]!==_0x599c28(0x167)){const _0xde070b={};return _0xde070b[_0x9ab525[_0x599c28(0x14d)]]={[Op[_0x599c28(0x16e)]]:'%'+_0xe0547a[_0x599c28(0x17b)][_0x599c28(0x170)]+'%'},_0xde070b;}})}));_0x2008a8=_[_0x327b5f(0x16a)]({},_0x2008a8,_0xe0547a[_0x327b5f(0x180)]);const _0x4b75dd={'where':_0x2008a8[_0x327b5f(0x15f)]};return db[_0x327b5f(0x171)][_0x327b5f(0x15a)](_0x4b75dd)[_0x327b5f(0x17c)](function(_0x3002a0){const _0x55e20f=_0x327b5f;return _0x1aabd6[_0x55e20f(0x15a)]=_0x3002a0,_0xe0547a['query'][_0x55e20f(0x169)]&&(_0x2008a8[_0x55e20f(0x16f)]=[{'all':!![]}]),db['Pause'][_0x55e20f(0x160)](_0x2008a8);})[_0x327b5f(0x17c)](function(_0x5282d2){const _0x41e49b=_0x327b5f;return _0x1aabd6[_0x41e49b(0x14b)]=_0x5282d2,_0x1aabd6;})[_0x327b5f(0x17c)](respondWithFilteredResult(_0x5e52de,_0x2008a8))[_0x327b5f(0x17e)](handleError(_0x5e52de,null));},exports[a612_0x4365d3(0x182)]=function(_0x483065,_0xaaeed9){const _0x4ae220=a612_0x4365d3;let _0x13b708={'raw':!![],'where':{'id':_0x483065[_0x4ae220(0x158)]['id']}};const _0x3e3cc5={};return _0x3e3cc5[_0x4ae220(0x168)]=_['keys'](db[_0x4ae220(0x171)][_0x4ae220(0x173)]),_0x3e3cc5[_0x4ae220(0x17b)]=_[_0x4ae220(0x148)](_0x483065[_0x4ae220(0x17b)]),_0x3e3cc5['filters']=_['intersection'](_0x3e3cc5[_0x4ae220(0x168)],_0x3e3cc5[_0x4ae220(0x17b)]),_0x13b708[_0x4ae220(0x154)]=_[_0x4ae220(0x162)](_0x3e3cc5['model'],qs['fields'](_0x483065[_0x4ae220(0x17b)][_0x4ae220(0x178)])),_0x13b708[_0x4ae220(0x154)]=_0x13b708[_0x4ae220(0x154)][_0x4ae220(0x147)]?_0x13b708[_0x4ae220(0x154)]:_0x3e3cc5[_0x4ae220(0x168)],_0x483065[_0x4ae220(0x17b)]['includeAll']&&(_0x13b708['include']=[{'all':!![]}]),_0x13b708=_[_0x4ae220(0x16a)]({},_0x13b708,_0x483065[_0x4ae220(0x180)]),db[_0x4ae220(0x171)][_0x4ae220(0x156)](_0x13b708)['then'](handleEntityNotFound(_0xaaeed9,null))['then'](respondWithResult(_0xaaeed9,null))[_0x4ae220(0x17e)](handleError(_0xaaeed9,null));},exports[a612_0x4365d3(0x15b)]=function(_0x37b557,_0x3c1581){const _0x3a7b8f=a612_0x4365d3;return db[_0x3a7b8f(0x171)][_0x3a7b8f(0x15b)](_0x37b557[_0x3a7b8f(0x17a)],{})['then'](function(_0x12299f){const _0x1db2f2=_0x3a7b8f,_0x308aaa=_0x37b557[_0x1db2f2(0x145)]['get']({'plain':!![]});if(!_0x308aaa)throw new Error(_0x1db2f2(0x165));if(_0x308aaa[_0x1db2f2(0x17f)]==='user'){const _0x550690=_0x12299f[_0x1db2f2(0x17d)]({'plain':!![]}),_0x48cced=_0x1db2f2(0x153);return db[_0x1db2f2(0x161)][_0x1db2f2(0x156)]({'where':{'name':_0x48cced,'userProfileId':_0x308aaa[_0x1db2f2(0x15e)]},'raw':!![]})[_0x1db2f2(0x17c)](function(_0xf5109a){const _0x273fee=_0x1db2f2;return _0xf5109a&&_0xf5109a[_0x273fee(0x16b)]===0x0?db[_0x273fee(0x179)][_0x273fee(0x15b)]({'name':_0x550690[_0x273fee(0x14d)],'resourceId':_0x550690['id'],'type':_0xf5109a[_0x273fee(0x14d)],'sectionId':_0xf5109a['id']},{})[_0x273fee(0x17c)](function(){return _0x12299f;}):_0x12299f;})[_0x1db2f2(0x17e)](function(_0x2ef81d){const _0x3c3a11=_0x1db2f2;logger[_0x3c3a11(0x166)](_0x3c3a11(0x149),_0x2ef81d);throw _0x2ef81d;});}return _0x12299f;})['then'](respondWithResult(_0x3c1581,0xc9))[_0x3a7b8f(0x17e)](handleError(_0x3c1581,null));},exports[a612_0x4365d3(0x159)]=function(_0x15cb50,_0x553041){const _0x53952f=a612_0x4365d3;return _0x15cb50[_0x53952f(0x17a)]['id']&&delete _0x15cb50[_0x53952f(0x17a)]['id'],db[_0x53952f(0x171)][_0x53952f(0x156)]({'where':{'id':_0x15cb50[_0x53952f(0x158)]['id']}})[_0x53952f(0x17c)](handleEntityNotFound(_0x553041,null))['then'](saveUpdates(_0x15cb50['body'],null))[_0x53952f(0x17c)](respondWithResult(_0x553041,null))[_0x53952f(0x17e)](handleError(_0x553041,null));},exports['destroy']=function(_0x217543,_0x40eba8){const _0x5435e4=a612_0x4365d3;return db[_0x5435e4(0x171)]['findOne']({'where':{'id':_0x217543[_0x5435e4(0x158)]['id']}})['then'](handleEntityNotFound(_0x40eba8,null))[_0x5435e4(0x17c)](removeEntity(_0x40eba8,null))[_0x5435e4(0x17e)](handleError(_0x40eba8,null));};
\ No newline at end of file