mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
catch added to getattachmentsbyid call
This commit is contained in:
@@ -117,7 +117,12 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
|
||||
async getAttachments() {
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
try {
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
} catch (error) {
|
||||
console.error('getAttchaments',error)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -481,9 +481,13 @@ export class EditEventToApprovePage implements OnInit {
|
||||
|
||||
|
||||
async getAttachments() {
|
||||
|
||||
let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
|
||||
let result: any;
|
||||
try {
|
||||
result = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||
} catch (error) {
|
||||
console.error('getAttachment',error)
|
||||
}
|
||||
|
||||
result.forEach((e)=>{
|
||||
e.action = false
|
||||
})
|
||||
|
||||
@@ -456,7 +456,12 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
async getAttachments(eventId: string){
|
||||
const rest: any = this.attachmentsService.getAttachmentsById(eventId).toPromise()
|
||||
let rest: any;
|
||||
try {
|
||||
rest = this.attachmentsService.getAttachmentsById(eventId).toPromise()
|
||||
} catch (error) {
|
||||
console.error('getAttchment', error)
|
||||
}
|
||||
this.loadedEventAttachments = rest;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user