
* Chore: Enable Users to create multiple accounts Addresses: #402 - migrations to split roles and other attributes from users table - make changes in code to accommodate this change Co-authored-by: Pranav Raj Sreepuram <pranavrajs@gmail.com>
24 lines
569 B
JavaScript
24 lines
569 B
JavaScript
/* eslint no-console: 0 */
|
|
/* global axios */
|
|
import ApiClient from '../ApiClient';
|
|
|
|
class MessageApi extends ApiClient {
|
|
constructor() {
|
|
super('conversations', { accountScoped: true });
|
|
}
|
|
|
|
create({ conversationId, message, private: isPrivate }) {
|
|
return axios.post(`${this.url}/${conversationId}/messages`, {
|
|
message,
|
|
private: isPrivate,
|
|
});
|
|
}
|
|
|
|
getPreviousMessages({ conversationId, before }) {
|
|
return axios.get(`${this.url}/${conversationId}/messages`, {
|
|
params: { before },
|
|
});
|
|
}
|
|
}
|
|
|
|
export default new MessageApi();
|