fix atachments bug

This commit is contained in:
tiago.kayaya
2021-04-06 11:34:23 +01:00
parent 2a3e3dcc2c
commit b3cdbc5681
2 changed files with 8 additions and 8 deletions
@@ -52,8 +52,8 @@
<div class="line"></div>
<div *ngIf="loadedAttachments" class="bottom-content">
<h5>Documentos Anexados</h5>
<ion-list>
<h3>Documentos Anexados</h3>
<ion-item lines="none" class="ion-no-margin ion-no-padding">
<ion-label *ngFor="let attach of loadedAttachments"
(click)="viewDocument(attach.SourceId)">
@@ -50,18 +50,19 @@ export class ViewEventPage implements OnInit {
this.loadedEvent = new Event();
this.eventBody = { BodyType : "1", Text : ""};
this.loadedEvent.Body = this.eventBody;
}
ngOnInit() {
/* console.log(this.eventId); */
this.loadEvent();
this.getAttachments();
//this.getAttachments();
}
ngOnChanges(changes: any): void {
this.loadedAttachments = null;
this.loadEvent();
this.getAttachments();
}
close(){
@@ -75,12 +76,11 @@ export class ViewEventPage implements OnInit {
loadEvent(){
this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res;
console.log(res);
this.today = new Date(res.StartDate);
console.log(new Date(this.today));
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
this.getAttachments(this.loadedEvent.EventId);
});
}
deleteEvent(){
@@ -97,8 +97,8 @@ export class ViewEventPage implements OnInit {
});
}
getAttachments(){
this.attachmentsService.getAttachmentsById(this.eventId).subscribe(res=>{
getAttachments(eventId){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedAttachments = res;
console.log(res);
});