cae1bcbc27af70c9a87b0be2898665adad431a0b
[motion-next.git] / server / api / attachment / attachment.rpc.js
1 const a31_0x3e30=['error','raw','../../mysqldb','stringify','create','then','options','message','info','body','CreateAttachment'];(function(_0x6f9b50,_0x3e30b6){const _0x58d17b=function(_0x1bba94){while(--_0x1bba94){_0x6f9b50['push'](_0x6f9b50['shift']());}};_0x58d17b(++_0x3e30b6);}(a31_0x3e30,0x134));const a31_0x58d1=function(_0x6f9b50,_0x3e30b6){_0x6f9b50=_0x6f9b50-0x0;let _0x58d17b=a31_0x3e30[_0x6f9b50];return _0x58d17b;};const _0x4b2b01=a31_0x58d1;'use strict';const db=require(_0x4b2b01('0x2'))['db'],logger=require('../../config/logger')('rpc');exports['CreateAttachment']=function(_0x1bba94){const _0x4b2c46=this;return new Promise(function(_0xe57ccb,_0x361f70){const _0x203876=a31_0x58d1;return db['Attachment'][_0x203876('0x4')](_0x1bba94[_0x203876('0x9')],{'raw':_0x1bba94[_0x203876('0x6')]?_0x1bba94[_0x203876('0x6')][_0x203876('0x1')]===undefined?!![]:![]:!![]})[_0x203876('0x5')](function(_0x28a815){const _0x23ebda=_0x203876;logger[_0x23ebda('0x8')](_0x23ebda('0xa'),_0x1bba94),logger['debug'](_0x23ebda('0xa'),_0x1bba94,JSON[_0x23ebda('0x3')](_0x28a815)),_0xe57ccb(_0x28a815);})['catch'](function(_0x15b899){const _0x2414ff=_0x203876;logger[_0x2414ff('0x0')](_0x2414ff('0xa'),_0x15b899[_0x2414ff('0x7')],_0x1bba94),_0x361f70(_0x4b2c46[_0x2414ff('0x0')](0x1f4,_0x15b899[_0x2414ff('0x7')]));});});};