This commit is contained in:
tiago.kayaya
2021-10-20 12:02:15 +01:00
14 changed files with 457 additions and 409 deletions
@@ -209,6 +209,7 @@ export class EditEventPage implements OnInit {
this.toastService.successMessage();
}, error => {
if(error.status != 0)
this.toastService.badRequest()
});
@@ -18,6 +18,7 @@ import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting
import { ExpedientTaskModalPage } from '../../gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { BackgroundService } from 'src/app/services/background.service';
import { StorageService } from 'src/app/services/storage.service';
@Component({
selector: 'app-view-event',
@@ -66,7 +67,8 @@ export class ViewEventPage implements OnInit {
private location: Location,
public platform: Platform,
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService
private backgroundservice: BackgroundService,
private storage: StorageService
) {
this.isEventEdited = false;
this.loadedEvent = new Event();
@@ -100,6 +102,22 @@ export class ViewEventPage implements OnInit {
this.loadEvent();
this.backgroundservice.registerBackService('Online', () => {
this.storage.get('eventEdit').then((req) => {
JSON.parse(req).forEach(element => {
this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventEdit')
console.log('eventEdit synchnize', res)
})
});
})
this.storage.get('eventDelete').then((req) => {
JSON.parse(req).forEach(element => {
this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventDelete')
console.log('eventEdit synchnize', res)
})
});
})
this.loadEvent();
});