improve chat

This commit is contained in:
Peter Maquiran
2022-02-03 21:01:53 +01:00
parent 33a2982805
commit 61de7b937b
13 changed files with 1147 additions and 668 deletions
+41
View File
@@ -20,6 +20,47 @@ export class AttachmentsService {
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
}
uploadFile(formData:any) {
console.log('UPLOAD file', formData)
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
const geturl = environment.apiURL + 'ObjectServer/UploadFiles';
let options = {
headers: this.headers
};
return this.http.post(`${geturl}`, formData, options);
}
getFile(guid:any) {
const geturl = environment.apiURL + 'lakefs/StreamFile';
let params = new HttpParams();
params = params.set("path", guid);
this.headers = this.headers.set('responseType', 'blob');
this.headers = this.headers.set('Content-Type', 'application/octet-stream');
let options = {
headers: this.headers,
params: params
};
return this.http.get<any>(`${geturl}`, options);
}
downloadFile(guid:any) {
let downloadUrl = environment.apiURL +'objectserver/streamfiles?path='+guid;
var name = new Date().getTime();
return this.http.get(downloadUrl, {
responseType: "arraybuffer",
reportProgress: true, observe: 'events'
})
}
getAttachmentsBySerial(serialNumber: string): Observable<Attachment[]>{
let geturl = environment.apiURL + 'attachments/GetAttachments';
let params = new HttpParams();