{"ast":null,"code":"import _regeneratorRuntime from\"C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/node_modules/babel-preset-react-app/node_modules/@babel/runtime/regenerator\";import _asyncToGenerator from\"C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/asyncToGenerator\";import _classCallCheck from\"C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/node_modules/babel-preset-react-app/node_modules/@babel/runtime/helpers/esm/classCallCheck\";import axios from\"axios\";var TagServicesClass=function TagServicesClass(){_classCallCheck(this,TagServicesClass);this.getAll=/*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(){return _regeneratorRuntime.wrap(function _callee2$(_context2){while(1){switch(_context2.prev=_context2.next){case 0:return _context2.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(resolve,reject){return _regeneratorRuntime.wrap(function _callee$(_context){while(1){switch(_context.prev=_context.next){case 0:_context.next=2;return axios.get(process.env.REACT_APP_BASE_URL+\"/tags\").then(function(res){resolve(res.data);});case 2:case\"end\":return _context.stop();}}},_callee);}));return function(_x,_x2){return _ref2.apply(this,arguments);};}()));case 1:case\"end\":return _context2.stop();}}},_callee2);}));this.store=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(params){return _regeneratorRuntime.wrap(function _callee4$(_context4){while(1){switch(_context4.prev=_context4.next){case 0:return _context4.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref4=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(resolve,reject){return _regeneratorRuntime.wrap(function _callee3$(_context3){while(1){switch(_context3.prev=_context3.next){case 0:_context3.next=2;return axios.post(process.env.REACT_APP_BASE_URL+\"/tags\",params).then(function(res){resolve(res.data);});case 2:case\"end\":return _context3.stop();}}},_callee3);}));return function(_x4,_x5){return _ref4.apply(this,arguments);};}()));case 1:case\"end\":return _context4.stop();}}},_callee4);}));return function(_x3){return _ref3.apply(this,arguments);};}();this.findOne=/*#__PURE__*/function(){var _ref5=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id){return _regeneratorRuntime.wrap(function _callee6$(_context6){while(1){switch(_context6.prev=_context6.next){case 0:return _context6.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref6=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(resolve,reject){return _regeneratorRuntime.wrap(function _callee5$(_context5){while(1){switch(_context5.prev=_context5.next){case 0:_context5.next=2;return axios.put(process.env.REACT_APP_BASE_URL+\"/tags/\"+id).then(function(res){resolve(res.data);});case 2:case\"end\":return _context5.stop();}}},_callee5);}));return function(_x7,_x8){return _ref6.apply(this,arguments);};}()));case 1:case\"end\":return _context6.stop();}}},_callee6);}));return function(_x6){return _ref5.apply(this,arguments);};}();this.update=/*#__PURE__*/function(){var _ref7=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(id,params){return _regeneratorRuntime.wrap(function _callee8$(_context8){while(1){switch(_context8.prev=_context8.next){case 0:return _context8.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref8=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(resolve,reject){return _regeneratorRuntime.wrap(function _callee7$(_context7){while(1){switch(_context7.prev=_context7.next){case 0:_context7.next=2;return axios.patch(process.env.REACT_APP_BASE_URL+\"/tags/\"+id,params).then(function(res){resolve(res.data);});case 2:case\"end\":return _context7.stop();}}},_callee7);}));return function(_x11,_x12){return _ref8.apply(this,arguments);};}()));case 1:case\"end\":return _context8.stop();}}},_callee8);}));return function(_x9,_x10){return _ref7.apply(this,arguments);};}();this.delete=/*#__PURE__*/function(){var _ref9=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id){return _regeneratorRuntime.wrap(function _callee10$(_context10){while(1){switch(_context10.prev=_context10.next){case 0:return _context10.abrupt(\"return\",new Promise(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(resolve,reject){return _regeneratorRuntime.wrap(function _callee9$(_context9){while(1){switch(_context9.prev=_context9.next){case 0:_context9.next=2;return axios.delete(process.env.REACT_APP_BASE_URL+\"/tags/\"+id).then(function(res){resolve(res.data);});case 2:case\"end\":return _context9.stop();}}},_callee9);}));return function(_x14,_x15){return _ref10.apply(this,arguments);};}()));case 1:case\"end\":return _context10.stop();}}},_callee10);}));return function(_x13){return _ref9.apply(this,arguments);};}();};export default TagServicesClass;","map":{"version":3,"sources":["C:/laragon/www/iot.mksolusi/DriverOPCDA/frontend/src/components/pages/TagGroups/TagServicesClass.ts"],"names":["axios","TagServicesClass","getAll","Promise","resolve","reject","get","process","env","REACT_APP_BASE_URL","then","res","data","store","params","post","findOne","id","put","update","patch","delete"],"mappings":"ofAAA,MAAOA,CAAAA,KAAP,KAAkB,OAAlB,C,GAEMC,CAAAA,gB,yEACGC,M,sEAAS,yKACP,GAAIC,CAAAA,OAAJ,2FAAY,iBAAOC,OAAP,CAAgBC,MAAhB,wIACXL,CAAAA,KAAK,CACRM,GADG,CACCC,OAAO,CAACC,GAAR,CAAYC,kBAAZ,CAAiC,OADlC,EAEHC,IAFG,CAEE,SAACC,GAAD,CAAS,CACbP,OAAO,CAACO,GAAG,CAACC,IAAL,CAAP,CACD,CAJG,CADW,uDAAZ,oEADO,0D,QAUTC,K,2FAAQ,kBAAOC,MAAP,uJACN,GAAIX,CAAAA,OAAJ,2FAAY,kBAAOC,OAAP,CAAgBC,MAAhB,6IACXL,CAAAA,KAAK,CACRe,IADG,CACER,OAAO,CAACC,GAAR,CAAYC,kBAAZ,CAAiC,OADnC,CAC4CK,MAD5C,EAEHJ,IAFG,CAEE,SAACC,GAAD,CAAS,CACbP,OAAO,CAACO,GAAG,CAACC,IAAL,CAAP,CACD,CAJG,CADW,yDAAZ,qEADM,0D,sEAURI,O,2FAAU,kBAAOC,EAAP,uJACR,GAAId,CAAAA,OAAJ,2FAAY,kBAAOC,OAAP,CAAgBC,MAAhB,6IACXL,CAAAA,KAAK,CACRkB,GADG,CACCX,OAAO,CAACC,GAAR,CAAYC,kBAAZ,CAAiC,QAAjC,CAA4CQ,EAD7C,EAEHP,IAFG,CAEE,SAACC,GAAD,CAAS,CACbP,OAAO,CAACO,GAAG,CAACC,IAAL,CAAP,CACD,CAJG,CADW,yDAAZ,qEADQ,0D,sEAUVO,M,2FAAS,kBAAOF,EAAP,CAAmBH,MAAnB,uJACP,GAAIX,CAAAA,OAAJ,2FAAY,kBAAOC,OAAP,CAAgBC,MAAhB,6IACXL,CAAAA,KAAK,CACRoB,KADG,CACGb,OAAO,CAACC,GAAR,CAAYC,kBAAZ,CAAiC,QAAjC,CAA4CQ,EAD/C,CACmDH,MADnD,EAEHJ,IAFG,CAEE,SAACC,GAAD,CAAS,CACbP,OAAO,CAACO,GAAG,CAACC,IAAL,CAAP,CACD,CAJG,CADW,yDAAZ,uEADO,0D,2EAUTS,M,2FAAS,mBAAOJ,EAAP,4JACP,GAAId,CAAAA,OAAJ,4FAAY,kBAAOC,OAAP,CAAgBC,MAAhB,6IACXL,CAAAA,KAAK,CACRqB,MADG,CACId,OAAO,CAACC,GAAR,CAAYC,kBAAZ,CAAiC,QAAjC,CAA4CQ,EADhD,EAEHP,IAFG,CAEE,SAACC,GAAD,CAAS,CACbP,OAAO,CAACO,GAAG,CAACC,IAAL,CAAP,CACD,CAJG,CADW,yDAAZ,wEADO,4D,oEAWlB,cAAeX,CAAAA,gBAAf","sourcesContent":["import axios from \"axios\";\r\n\r\nclass TagServicesClass {\r\n  public getAll = async () => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .get(process.env.REACT_APP_BASE_URL + \"/tags\")\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n\r\n  public store = async (params: any) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .post(process.env.REACT_APP_BASE_URL + \"/tags\", params)\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n\r\n  public findOne = async (id: number) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .put(process.env.REACT_APP_BASE_URL + \"/tags/\" + id)\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n\r\n  public update = async (id: number, params: any) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .patch(process.env.REACT_APP_BASE_URL + \"/tags/\" + id, params)\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n\r\n  public delete = async (id: number) => {\r\n    return new Promise(async (resolve, reject) => {\r\n      await axios\r\n        .delete(process.env.REACT_APP_BASE_URL + \"/tags/\" + id)\r\n        .then((res) => {\r\n          resolve(res.data);\r\n        });\r\n    });\r\n  };\r\n}\r\n\r\nexport default TagServicesClass;\r\n"]},"metadata":{},"sourceType":"module"}