Feature: Send attachments to widget user (#621)
This commit is contained in:
committed by
GitHub
parent
fe70843fae
commit
f7e5f1fabf
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user