improve publication

This commit is contained in:
Peter Maquiran
2023-02-27 20:17:03 +01:00
parent 368607e81c
commit f218b1a666
2 changed files with 35 additions and 33 deletions
@@ -59,6 +59,8 @@ export class ViewPublicationsPage implements OnInit {
window['app-view-publications-page-doRefresh'] = this.doRefresh
this.getPublicationDetail();
this.getFromDB();
}
ngOnChanges(changes: any): void {
@@ -67,7 +69,7 @@ export class ViewPublicationsPage implements OnInit {
this.folderId = this.folderId['ProcessId']
}
this.getFromDB();
//setTimeout(()=>{
this.getPublicationDetail();
this.getPublicationsIds();
@@ -119,8 +121,8 @@ export class ViewPublicationsPage implements OnInit {
});
this.storage.remove('view_publications');
this.storage.set('view_publications', this.publicationList);
this.storage.remove(folderId);
this.storage.set(this.folderId, this.publicationList);
this.getpublication = this.publicationList;
@@ -132,39 +134,39 @@ export class ViewPublicationsPage implements OnInit {
}
getFromDB() {
this.storage.get('view_publications').then((viewPublications) => {
this.storage.get(this.folderId).then((viewPublications) => {
this.publicationList = viewPublications;
})
}
getPublications() {
this.showLoader = true;
const folderId = this.folderId
this.publicationList = new Array();
//this.getFromDB();
this.publications.GetPublications(folderId).subscribe(async res=> {
// getPublications() {
// this.showLoader = true;
// const folderId = this.folderId
// this.publicationList = new Array();
// this.publications.GetPublications(folderId).subscribe(async res=> {
res.forEach(element => {
let item: Publication = this.publicationPipe.itemList(element)
this.publicationList.push(item);
});
// res.forEach(element => {
// let item: Publication = this.publicationPipe.itemList(element)
// this.publicationList.push(item);
// });
await this.storage.remove('view_publications');
await this.storage.set('view_publications', this.publicationList);
//this.getFromDB();
this.showLoader = false;
},
(error)=>{
if(error.status == '404') {
this.error = 'Sem publicações disponíveis!';
this.publicationList= [];
}
// this.showLoader = false;
// await this.storage.remove(folderId);
// await this.storage.set(folderId, this.publicationList);
// //this.getFromDB();
// },
// (error)=>{
// if(error.status == '404') {
// this.error = 'Sem publicações disponíveis!';
// this.publicationList= [];
// }
this.showLoader = false;
// this.showLoader = false;
})
// })
}
// }
async AddPublication(publicationType:any, folderId:any) {
+6 -6
View File
@@ -1,12 +1,12 @@
export let versionData = {
"shortSHA": "d289f377b",
"SHA": "d289f377b5f325c93aabed6f5a816583b565a4ae",
"shortSHA": "368607e81",
"SHA": "368607e81cd152a15ecd7aa047c5e33c3de38378",
"branch": "no_bug_movemente",
"lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Mon Feb 27 19:52:30 2023 +0100'",
"lastCommitMessage": "fix publication",
"lastCommitNumber": "4841",
"lastCommitTime": "'Mon Feb 27 20:04:22 2023 +0100'",
"lastCommitMessage": "improve publications",
"lastCommitNumber": "4842",
"change": "",
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/publications/view-publications/view-publications.page.ts\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts",
"changeStatus": "On branch no_bug_movemente\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/shared/publication/view-publications/view-publications.page.ts",
"changeAuthor": "peter.maquiran"
}