Fixed upload feature

Added new design to message options
This commit is contained in:
tiago.kayaya
2021-10-06 17:27:49 +01:00
parent 9a629628f3
commit cfd896dfca
8 changed files with 120 additions and 30 deletions
+6 -25
View File
@@ -21,6 +21,8 @@ export class FileService {
documents:SearchList[] = [];
showLoader: boolean;
files: Set<File>;
constructor(
private camera: Camera,
private fileLoaderService: FileLoaderService,
@@ -160,33 +162,12 @@ export class FileService {
console.log(file);
const imageData = await this.fileToBase64Service.convert(file)
this.capturedImage = imageData;
this.capturedImageTitle = file.name;
const formData = new FormData();
formData.append('file', file, file.name);
let body = {
"message":
{
"rid": roomId,
"msg": "",
"attachments": [{
"title": this.capturedImageTitle,
"text": "",
"title_link": this.capturedImage,
"title_link_download": true,
"message_link": this.capturedImage,
"type": "file"
}],
"file":{
"name": this.capturedImageTitle,
"type": "application/pdf",
}
}
}
this.chatService.sendMessage(body).subscribe(res=> {
this.chatService.uploadFile(formData, roomId).subscribe(res=> {
console.log(res);
loader.remove();
//console.log(res);
},(error) => {
loader.remove();
});