mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
add models
This commit is contained in:
+1
-1
@@ -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: '',
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</button >
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-body width-100">
|
||||
<div class="div-body width-100" *ngIf="publicationItem[folderId].DateBegin">
|
||||
<p class="item-content-detail">{{publicationItem[folderId].Detail}}</p>
|
||||
<p class="item-content-date">{{ publicationItem[folderId].DateBegin | date: 'dd-MM-yy HH:mm'}}</p>
|
||||
</div>
|
||||
|
||||
@@ -12,6 +12,7 @@ import { EditActionPage } from 'src/app/pages/publications/edit-action/edit-acti
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { PublicationModel } from 'src/app/models/beast-orm';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-publications',
|
||||
@@ -116,20 +117,24 @@ export class ViewPublicationsPage implements OnInit {
|
||||
const folderId = this.folderId
|
||||
|
||||
try {
|
||||
const res = await this.publications.GetPublicationsImages(folderId).toPromise();
|
||||
let publicationList = []
|
||||
|
||||
for (let element of res) {
|
||||
let ress = await this.publications.GetPublicationById(element).toPromise();
|
||||
let item: Publication = this.publicationPipe.itemList(ress)
|
||||
publicationList.push(item);
|
||||
const publicationIds = await this.publications.GetPublicationsList(folderId).toPromise();
|
||||
|
||||
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