mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
add models
This commit is contained in:
@@ -11,7 +11,7 @@ import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||
@@ -130,8 +130,8 @@ export class EventsPage implements OnInit {
|
||||
if (event) {
|
||||
setTimeout(() => {
|
||||
try {
|
||||
event?.target?.complete();
|
||||
} catch(error) {}
|
||||
event?.target?.complete();
|
||||
} catch(error) {}
|
||||
}, 2000);
|
||||
}
|
||||
this.RefreshEvents();
|
||||
@@ -166,7 +166,7 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
this.showAgendaLoader = false;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
/* this.folderId = this.navParams.get('folderIdId'); */
|
||||
this.publication = {
|
||||
DateIndex: null,
|
||||
DocumentId: '',
|
||||
DocumentId: null,
|
||||
ProcessId:'',
|
||||
Title:'',
|
||||
Message: '',
|
||||
|
||||
@@ -16,6 +16,7 @@ import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ActionModel } from 'src/app/models/beast-orm';
|
||||
|
||||
|
||||
@Component({
|
||||
@@ -146,7 +147,11 @@ export class PublicationsPage implements OnInit {
|
||||
this.publications.GetPublicationFolderList().subscribe(async res => {
|
||||
this.showLoader = false;
|
||||
const folders: PublicationFolder[] = this.getPublicationFolderMap(res)
|
||||
|
||||
let publications = await ActionModel.create(folders)
|
||||
|
||||
console.log('publications', publications)
|
||||
|
||||
this.publicationsEventFolderList = folders.filter((e)=>e.ActionType == 'Evento')
|
||||
this.publicationsTravelFolderList = folders.filter((e)=>e.ActionType != 'Evento')
|
||||
|
||||
|
||||
+1
-1
@@ -46,7 +46,7 @@ export class PublicationDetailPage implements OnInit {
|
||||
|
||||
this.publication = {
|
||||
DateIndex: null,
|
||||
DocumentId: '',
|
||||
DocumentId: null,
|
||||
ProcessId:'',
|
||||
Title:'',
|
||||
Message: '',
|
||||
|
||||
@@ -15,6 +15,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PublicationModel } from 'src/app/models/beast-orm';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -162,20 +163,24 @@ export class ViewPublicationsPage implements OnInit {
|
||||
const folderId = this.folderId
|
||||
|
||||
try {
|
||||
const res = await this.publications.GetPublicationsImages(folderId).toPromise();
|
||||
let publicationList = []
|
||||
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
|
||||
|
||||
for (let element of res) {
|
||||
let ress = await this.publications.GetPublicationById(element).toPromise();
|
||||
let item: Publication = this.publicationPipe.itemList(ress)
|
||||
publicationList.push(item);
|
||||
for (let publicationId of publicationIds) {
|
||||
let Publication = await this.publications.GetPublicationById(publicationId).toPromise();
|
||||
let publicationDetails: Publication = this.publicationPipe.itemList(Publication)
|
||||
|
||||
const found = this.publicationList[folderId].find( e => e.DocumentId == publicationId )
|
||||
|
||||
if(!found) {
|
||||
PublicationModel.create(publicationDetails)
|
||||
this.publicationList[folderId].push(publicationDetails)
|
||||
}
|
||||
}
|
||||
|
||||
this.showLoader = false;
|
||||
|
||||
this.publicationList[folderId] = publicationList
|
||||
this.storage.set(folderId, publicationList);
|
||||
this.getpublication = publicationList;
|
||||
this.storage.set(folderId, this.publicationList[folderId]);
|
||||
this.getpublication = this.publicationList[folderId];
|
||||
} catch(error) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user