This commit is contained in:
Peter Maquiran
2023-06-09 15:29:03 +01:00
parent 7f3cfdc55e
commit 2f38104155
12 changed files with 56 additions and 31 deletions
@@ -8,13 +8,12 @@
<ion-header>
<div class="title-content">
<div class="middle">
<ion-label class="title">Editar Evento</ion-label>
<ion-label id="vsdfajnl" class="title">Editar Evento</ion-label>
</div>
</div>
</ion-header>
</div>
<ion-item-sliding class="overflow-y-auto">
<div class="px-20">
<div class="ion-item-container width-100" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
@@ -487,13 +487,18 @@ export class EditEventPage implements OnInit {
}
getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
},((erro) => {
console.error('editgetAttchament', erro)
}));
getAttachments(eventId: string) {
if(this.postEvent.HasAttachments) {
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res;
},((erro) => {
console.error('editgetAttchament', erro)
}));
}
}
deleteAttachment(attachmentID: string, index) {
@@ -20,7 +20,7 @@ import { Storage } from '@ionic/storage';
import { SessionStore } from 'src/app/store/session.service';
import { CalendarService } from 'src/app/store/calendar.service';
import { HttpErrorHandle} from 'src/app/services/http-error-handle.service'
import { AttachmentsService } from 'src/app/services/attachments.service';
@Component({
selector: 'app-view-event',
@@ -73,7 +73,8 @@ export class ViewEventPage implements OnInit {
private RouteService: RouteService,
private ionicStorage: Storage,
private CalendarService: CalendarService,
private httpErrorHandle: HttpErrorHandle
private httpErrorHandle: HttpErrorHandle,
private attachmentsService: AttachmentsService,
) {
@@ -394,6 +395,7 @@ export class ViewEventPage implements OnInit {
setTimeout(() => {
/* this.loadEvent(); */
this.loadEvent()
this.getAttachments()
}, 250);
this.isEventEdited = true;
}
@@ -404,6 +406,18 @@ export class ViewEventPage implements OnInit {
this.dicIndex = index
}
getAttachments() {
if(this.loadedEvent.HasAttachments) {
this.attachmentsService.getAttachmentsById(this.loadedEvent.EventId).subscribe(res=>{
this.loadedEvent.Attachments = res;
},((erro) => {
console.error('editgetAttchament', erro)
}));
}
}
async LoadDocumentDetails() {
const docId = this.loadedEvent.Attachments[this.dicIndex].SourceId