UNPKG

@graphteon/juricode

Version:

We are forging the future with lines of digital steel

29 lines 1.16 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConversationService = void 0; const axios_1 = __importDefault(require("axios")); class ConversationService { constructor() { this.baseUrl = process.env.BACKEND_URL || 'http://localhost:4000'; } async createConversation(input) { const response = await axios_1.default.post(`${this.baseUrl}/api/conversations`, input); return response.data; } async getConversations() { const response = await axios_1.default.get(`${this.baseUrl}/api/conversations?limit=20`); return response.data.results; } async getConversation(id) { const response = await axios_1.default.get(`${this.baseUrl}/api/conversations/${id}`); return response.data; } async deleteConversation(id) { await axios_1.default.delete(`${this.baseUrl}/api/conversations/${id}`); } } exports.ConversationService = ConversationService; //# sourceMappingURL=conversation.js.map