Feature: Send attachments to widget user (#621)

This commit is contained in:
Nithin David Thomas
2020-03-22 15:54:36 +05:30
committed by GitHub
parent fe70843fae
commit f7e5f1fabf
16 changed files with 317 additions and 92 deletions

View File

@@ -19,6 +19,17 @@ class MessageApi extends ApiClient {
params: { before },
});
}
sendAttachment([conversationId, { file, file_type }]) {
const formData = new FormData();
formData.append('attachment[file]', file);
formData.append('attachment[file_type]', file_type);
return axios({
method: 'post',
url: `${this.url}/${conversationId}/messages`,
data: formData,
});
}
}
export default new MessageApi();