You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import apiService from './apiClient';
|
|
|
|
export interface ChatMessage {
|
|
|
|
type: string;
|
|
|
|
mimetype: string;
|
|
|
|
userWs: string;
|
|
|
|
app_id: string;
|
|
|
|
country: string;
|
|
|
|
body: string;
|
|
|
|
text: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ChatMessageData {
|
|
|
|
newMessage:ChatMessage;
|
|
|
|
}
|
|
|
|
// API methods
|
|
|
|
export const chatService = {
|
|
|
|
// Send message with retry mechanism
|
|
|
|
async sendMessage(newMessage:ChatMessageData): Promise<any> {
|
|
|
|
return apiService.post('https://api.brainnel.com/app_chat/chat',newMessage);
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|