Sha256: fb77505836ed357031e1a7f9ce73450c0b0333b36be89de6dbf6db3a4b4136c5

Contents?: true

Size: 710 Bytes

Versions: 2

Compression:

Stored size: 710 Bytes

Contents

import axios from 'axios';
const API = `${window.location.origin}/api`;

export function fetch(id) {
  return axios.get(`${API}/messages/get_conversation_messages?id=${id}`);

}

export function conversation(id, user, klass) {
  return axios.get(`${API}/conversations/conversation_info?id=${id}&user=${user}&class=${klass}`);
}

export function createMessage(body, sender, conversation, senderClass) {
  return axios.post(`${API}/messages/create_message`, { message: { body: body, conversation_id: conversation, sender: sender, sender_class: senderClass } });
}

export function deleteMessage(id, conversation) {
  return axios.delete(`${API}/messages/delete_message?id=${id}&conversation=${conversation}`);
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
denshobato_chat_panel-0.0.2 lib/react/api/Api.jsx
denshobato_chat_panel-0.0.1 lib/react/api/Api.jsx