mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix download attachment
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ export class AttachmentRemoteDataSourceService implements IAttachmentRemoteRepos
|
||||
) { }
|
||||
|
||||
async getAttachment(id: string | number): DataSourceReturn<Blob> {
|
||||
return await this.httpService.get(`${this.baseUrl}/attachment/${id}`, { responseType: 'blob' });
|
||||
return await this.httpService.getFile(`${this.baseUrl}/attachment/${id}`, { responseType: 'blob' });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -50,19 +50,6 @@ export class SyncAllRoomMessagesService {
|
||||
delete message.sentAt
|
||||
let clone: MessageTable = { ...message, roomId: room.id };
|
||||
this.messageLocalDataSourceService.update(clone.$id, clone);
|
||||
|
||||
// const me = message.info.find(e => e.memberId === SessionStore.user.UserId && typeof e.deliverAt === 'string');
|
||||
|
||||
// if (!me) {
|
||||
// this.MessageSocketRepositoryService.sendDeliverAt({
|
||||
// memberId: SessionStore.user.UserId,
|
||||
// messageId: message.id,
|
||||
// roomId: message.roomId,
|
||||
// requestId: uuidv4()
|
||||
// });
|
||||
|
||||
// tracing.addEvent('send deliver roomId ' + room.id);
|
||||
// }
|
||||
}
|
||||
|
||||
for (const message of addedItems) {
|
||||
|
||||
@@ -78,6 +78,15 @@ export class HttpService {
|
||||
}
|
||||
}
|
||||
|
||||
async getFile<T>(url: string, options ={}): Promise<Result<T, HttpErrorResponse>> {
|
||||
try {
|
||||
const result = await this.http.get<T>(url, options).toPromise()
|
||||
return ok (result as T)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
async put<T>(url: string, body: any): Promise<Result<T, HttpErrorResponse>> {
|
||||
|
||||
try {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user