UNPKG

phx-react

Version:

PHX REACT

23 lines 841 B
import { __awaiter, __generator } from "tslib"; import axios from 'axios'; var BASE_URL_SERVER = 'http://192.168.0.167:2000'; var API_ENDPOINT = { SEND_MAIL: '/emit/email-send' }; var EmailService = /** @class */ (function () { function EmailService() { var _this = this; this.sendEmail = function (data) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { switch (_a.label) { case 0: return [4 /*yield*/, axios.post(BASE_URL_SERVER + API_ENDPOINT.SEND_MAIL, data)]; case 1: return [2 /*return*/, _a.sent()]; } }); }); }; } return EmailService; }()); var emailService = new EmailService(); export default emailService; //# sourceMappingURL=email-service.js.map