Bug on synch event edit and delete and added offline synch to event to aprove REver

This commit is contained in:
Eudes Inácio
2021-11-16 13:12:25 +01:00
parent 487fe4ae6d
commit e7c3bbf3ae
6 changed files with 103 additions and 7 deletions
@@ -17,6 +17,7 @@ import { SqliteService } from '../../../../services/sqlite.service';
import { BackgroundService } from '../../../../services/background.service';
import { Platform } from '@ionic/angular';
import { ThemeService } from 'src/app/services/theme.service'
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
@Component({
@@ -62,6 +63,7 @@ export class ApproveEventPage implements OnInit {
private platform: Platform,
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
private offlineManager: OfflineManagerService
) {
this.activatedRoute.paramMap.subscribe(params => {
// console.log(params["params"]);
@@ -255,7 +257,11 @@ export class ApproveEventPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise();
await this.processes.PostTaskAction(body).toPromise()
.catch(() => {
console.log('Send event to approve for revition')
this.offlineManager.storeRequestData('event-listRever', body);
});
this.toastService._successMessage('Pedido enviado');
this.goBack();
} catch (error) {