Built motion from commit 241cdf54d.|1.0.27
[motion.git] / server / api / team / team.controller.js
1 var _0x539f=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x54\x65\x61\x6D","\x55\x73\x65\x72","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x61\x73\x73\x6F\x63\x69\x61\x74\x69\x6F\x6E\x73\x49\x6E\x64\x65\x78","\x6C\x65\x6E\x67\x74\x68","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x67\x65\x6E\x74\x73","\x72\x6F\x77\x73","\x69\x64","\x6D\x61\x70","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x72\x6F\x6C\x65","\x73\x68\x6F\x77","\x70\x61\x72\x61\x6D\x73","\x73\x68\x6F\x77\x41\x67\x65\x6E\x74\x73","\x55\x73\x65\x72\x73","\x63\x72\x65\x61\x74\x65","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73","\x61\x64\x64\x41\x67\x65\x6E\x74\x73","\x61\x64\x64\x55\x73\x65\x72\x73","\x72\x65\x6D\x6F\x76\x65\x41\x67\x65\x6E\x74\x73","\x72\x65\x6D\x6F\x76\x65\x55\x73\x65\x72","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x539f[0];var _=require(_0x539f[1]);var util=require(_0x539f[2]);var Util=require(_0x539f[3]);var logger=require(_0x539f[5])(_0x539f[4]);var sequelize=require(_0x539f[7])[_0x539f[6]];var Team=require(_0x539f[7])[_0x539f[8]];var Agent=require(_0x539f[7])[_0x539f[9]];var User=require(_0x539f[7])[_0x539f[9]];exports[_0x539f[10]]= function(_0x3e9bx9,_0x3e9bxa){return Team[_0x539f[20]](_0x539f[19])[_0x539f[18]](_[_0x539f[17]](Util[_0x539f[16]](_0x3e9bx9[_0x539f[15]])))[_0x539f[14]](function(_0x3e9bxc){_0x3e9bxa[_0x539f[13]](200)[_0x539f[12]](_0x3e9bxc)})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)})};exports[_0x539f[21]]= function(_0x3e9bx9,_0x3e9bxa){switch(_0x3e9bx9[_0x539f[30]][_0x539f[32]]){case _0x539f[30]:return User[_0x539f[31]](_0x3e9bx9[_0x539f[30]][_0x539f[26]])[_0x539f[14]](function(_0x3e9bxe){if(!_0x3e9bxe){return _0x3e9bxa[_0x539f[29]](404)};return _0x3e9bxe})[_0x539f[14]](Util[_0x539f[28]](_0x3e9bx9[_0x539f[15]]))[_0x539f[14]](function(_0x3e9bxd){return Team[_0x539f[20]]({method:[_0x539f[24],_[_0x539f[27]](_0x3e9bxd[_0x539f[25]],_0x539f[26])]})[_0x539f[23]](_[_0x539f[17]](Util[_0x539f[16]](_0x3e9bx9[_0x539f[15]])))})[_0x539f[14]](function(_0x3e9bxc){_0x3e9bxa[_0x539f[13]](200)[_0x539f[12]]({rows:_0x3e9bxc,count:_0x3e9bxc[_0x539f[22]]})})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)});default:return Team[_0x539f[20]](_0x539f[24])[_0x539f[23]](_[_0x539f[17]](Util[_0x539f[16]](_0x3e9bx9[_0x539f[15]])))[_0x539f[14]](function(_0x3e9bxc){_0x3e9bxa[_0x539f[13]](200)[_0x539f[12]]({rows:_0x3e9bxc,count:_0x3e9bxc[_0x539f[22]]})})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)})}};exports[_0x539f[33]]= function(_0x3e9bx9,_0x3e9bxa){return Team[_0x539f[31]](_0x3e9bx9[_0x539f[34]][_0x539f[26]])[_0x539f[14]](function(_0x3e9bxf){if(!_0x3e9bxf){return _0x3e9bxa[_0x539f[29]](404)};return _0x3e9bxa[_0x539f[12]](_0x3e9bxf)})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)})};exports[_0x539f[35]]= function(_0x3e9bx9,_0x3e9bxa){switch(_0x3e9bx9[_0x539f[30]][_0x539f[32]]){case _0x539f[30]:return User[_0x539f[31]](_0x3e9bx9[_0x539f[30]][_0x539f[26]])[_0x539f[14]](function(_0x3e9bxe){if(!_0x3e9bxe){return _0x3e9bxa[_0x539f[29]](404)};return _0x3e9bxe})[_0x539f[14]](Util[_0x539f[28]](_0x3e9bx9[_0x539f[15]]))[_0x539f[14]](function(_0x3e9bxd){return Team[_0x539f[20]]({method:[_0x539f[24],_[_0x539f[27]](_0x3e9bxd[_0x539f[25]],_0x539f[26])]})[_0x539f[31]](_0x3e9bx9[_0x539f[34]][_0x539f[26]])})[_0x539f[14]](function(_0x3e9bxf){if(!_0x3e9bxf){return _0x3e9bxa[_0x539f[29]](404)};return _0x3e9bxa[_0x539f[13]](200)[_0x539f[12]]({count:_0x3e9bxf[_0x539f[36]][_0x539f[22]],rows:_0x3e9bxf[_0x539f[36]]})})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)});default:return Team[_0x539f[20]](_0x539f[24])[_0x539f[31]](_0x3e9bx9[_0x539f[34]][_0x539f[26]])[_0x539f[14]](function(_0x3e9bxf){if(!_0x3e9bxf){return _0x3e9bxa[_0x539f[29]](404)};return _0x3e9bxa[_0x539f[13]](200)[_0x539f[12]]({count:_0x3e9bxf[_0x539f[36]][_0x539f[22]],rows:_0x3e9bxf[_0x539f[36]]})})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)})}};exports[_0x539f[37]]= function(_0x3e9bx9,_0x3e9bxa){return Team[_0x539f[37]](_0x3e9bx9[_0x539f[40]])[_0x539f[14]](function(_0x3e9bxf){return _0x3e9bxa[_0x539f[13]](201)[_0x539f[12]](_0x3e9bxf)})[_0x539f[11]](sequelize.UniqueConstraintError,function(_0x3e9bxb){return Util[_0x539f[39]][_0x539f[38]](_0x3e9bxa,_0x3e9bxb)})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)})};exports[_0x539f[41]]= function(_0x3e9bx9,_0x3e9bxa){if(_0x3e9bx9[_0x539f[40]][_0x539f[26]]){delete _0x3e9bx9[_0x539f[40]][_0x539f[26]]};return Team[_0x539f[31]](_0x3e9bx9[_0x539f[34]][_0x539f[26]])[_0x539f[14]](function(_0x3e9bxf){if(!_0x3e9bxf){return _0x3e9bxa[_0x539f[29]](404)};var _0x3e9bx10=_[_0x539f[17]](_0x3e9bxf,_0x3e9bx9[_0x539f[40]]);return _0x3e9bx10[_0x539f[42]]()})[_0x539f[14]](function(_0x3e9bxf){return _0x3e9bxa[_0x539f[13]](200)[_0x539f[12]](_0x3e9bxf)})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)})};exports[_0x539f[43]]= function(_0x3e9bx9,_0x3e9bxa){return Team[_0x539f[31]](_0x3e9bx9[_0x539f[34]][_0x539f[26]])[_0x539f[14]](function(_0x3e9bxf){if(!_0x3e9bxf){return _0x3e9bxa[_0x539f[29]](404)};return _0x3e9bxf[_0x539f[43]]()})[_0x539f[14]](function(){return _0x3e9bxa[_0x539f[29]](204)})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)})};exports[_0x539f[44]]= function(_0x3e9bx9,_0x3e9bxa){return Team[_0x539f[43]]({where:{id:_0x3e9bx9[_0x539f[15]][_0x539f[45]]},individualHooks:true})[_0x539f[14]](function(){return _0x3e9bxa[_0x539f[29]](204)})[_0x539f[11]](function(_0x3e9bxb){return handleError(_0x3e9bxa,_0x3e9bxb)})};exports[_0x539f[46]]= function(_0x3e9bx9,_0x3e9bxa,_0x3e9bx11){return Team[_0x539f[31]](_0x3e9bx9[_0x539f[34]][_0x539f[26]])[_0x539f[14]](function(_0x3e9bxf){if(!_0x3e9bxf){return _0x3e9bxa[_0x539f[29]](404)};return _0x3e9bxf[_0x539f[47]](_0x3e9bx9[_0x539f[40]][_0x539f[24]])})[_0x539f[14]](function(){return _0x3e9bxa[_0x539f[29]](204)})[_0x539f[11]](function(_0x3e9bxb){return _0x3e9bx11(_0x3e9bxb)})};exports[_0x539f[48]]= function(_0x3e9bx9,_0x3e9bxa,_0x3e9bx11){return Team[_0x539f[31]](_0x3e9bx9[_0x539f[34]][_0x539f[26]])[_0x539f[14]](function(_0x3e9bxf){if(!_0x3e9bxf){return _0x3e9bxa[_0x539f[29]](404)};return _0x3e9bxf[_0x539f[49]](_0x3e9bx9[_0x539f[15]][_0x539f[24]])})[_0x539f[14]](function(){return _0x3e9bxa[_0x539f[29]](202)})[_0x539f[11]](function(_0x3e9bxb){return _0x3e9bx11(_0x3e9bxb)})};function handleError(_0x3e9bxa,_0x3e9bxb){logger[_0x539f[51]](_0x3e9bxb[_0x539f[50]]);return _0x3e9bxa[_0x539f[13]](500)[_0x539f[12]](_0x3e9bxb)}