feat: Add pending message on dashboard (#1547)

This commit is contained in:
Nithin David Thomas 2020-12-25 13:15:01 +05:30 committed by GitHub
parent 3e61ea5cfa
commit 7c62d3629c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 260 additions and 53 deletions

View file

@ -7,10 +7,17 @@ class MessageApi extends ApiClient {
super('conversations', { accountScoped: true });
}
create({ conversationId, message, private: isPrivate, contentAttributes }) {
create({
conversationId,
message,
private: isPrivate,
contentAttributes,
echo_id: echoId,
}) {
return axios.post(`${this.url}/${conversationId}/messages`, {
content: message,
private: isPrivate,
echo_id: echoId,
content_attributes: contentAttributes,
});
}
@ -21,10 +28,11 @@ class MessageApi extends ApiClient {
});
}
sendAttachment([conversationId, { file, isPrivate = false }]) {
sendAttachment([conversationId, { file, isPrivate = false }, echoId]) {
const formData = new FormData();
formData.append('attachments[]', file, file.name);
formData.append('private', isPrivate);
formData.append('echo_id', echoId);
return axios({
method: 'post',
url: `${this.url}/${conversationId}/messages`,