Create file controller to upload audio document

This commit is contained in:
Gregoire Parant
2020-09-20 19:01:21 +02:00
parent 45ad4bbb36
commit 844bffa988
6 changed files with 171 additions and 19 deletions
+2 -2
View File
@@ -199,8 +199,8 @@ export class Connection implements Connection {
});
}
public uploadAudio(file : any){
return Axios.post(`${API_URL}/upload-audio-message`, {file}).then((res: any) => {
public uploadAudio(file : FormData){
return Axios.post(`${API_URL}/upload-audio-message`, file).then((res: any) => {
return res.data;
}).catch((err) => {
console.error(err);