mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Fixed upload feature
Added new design to message options
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user