@graphteon/juricode
Version:
We are forging the future with lines of digital steel
22 lines • 794 B
JavaScript
import axios from 'axios';
export class ConversationService {
constructor() {
this.baseUrl = process.env.BACKEND_URL || 'http://localhost:4000';
}
async createConversation(input) {
const response = await axios.post(`${this.baseUrl}/api/conversations`, input);
return response.data;
}
async getConversations() {
const response = await axios.get(`${this.baseUrl}/api/conversations?limit=20`);
return response.data.results;
}
async getConversation(id) {
const response = await axios.get(`${this.baseUrl}/api/conversations/${id}`);
return response.data;
}
async deleteConversation(id) {
await axios.delete(`${this.baseUrl}/api/conversations/${id}`);
}
}
//# sourceMappingURL=conversation.js.map