diff --git a/src/app/core/actions/use-case/publication-file-get-by-document-id.service.ts b/src/app/core/actions/use-case/publication-file-get-by-document-id.service.ts index 2eff7f931..cb1ceba87 100644 --- a/src/app/core/actions/use-case/publication-file-get-by-document-id.service.ts +++ b/src/app/core/actions/use-case/publication-file-get-by-document-id.service.ts @@ -69,7 +69,7 @@ export class PublicationFileGetByDocumentIdService { }); const start = performance.now(); - this.local.insert({ + await this.local.insert({ ...file, documentId: input.documentId!, datePublication: input.datePublication, @@ -83,8 +83,8 @@ export class PublicationFileGetByDocumentIdService { for (const localFile of localResult.value) { const found = httpResult.value.data.filter((e) => e.name === localFile.name); if (found.length === 0 && localFile.name) { - //remove.push(localFile); - //this.local.delete(localFile.id); + remove.push(localFile); + await this.local.delete(localFile.id); } } diff --git a/src/app/shared/publication/upload/publication-from-mv.service.ts b/src/app/shared/publication/upload/publication-from-mv.service.ts index 41e0654d4..ee7599e52 100644 --- a/src/app/shared/publication/upload/publication-from-mv.service.ts +++ b/src/app/shared/publication/upload/publication-from-mv.service.ts @@ -112,6 +112,7 @@ export class PublicationFromMvService { })) publication.ProcessId = this.folderId + publication.datePublication = new Date().toISOString() if(this.form.cancel) { window['upload-header-set-remove'](this.id); @@ -130,6 +131,8 @@ export class PublicationFromMvService { window['publicationEdit']() } + //this.publicationFolderService.loadPublication(this.form.DocumentId, this.folderId) + window['upload-header-set-remove'](this.id); } catch (error) { diff --git a/src/app/shared/publication/view-publications/view-publications.page.ts b/src/app/shared/publication/view-publications/view-publications.page.ts index f6ec0649b..d9d45eb86 100644 --- a/src/app/shared/publication/view-publications/view-publications.page.ts +++ b/src/app/shared/publication/view-publications/view-publications.page.ts @@ -163,11 +163,6 @@ export class ViewPublicationsPage implements OnInit { } - async loadPublication(publicationId, folderId) { - - await this.publicationFolderService.loadPublication(publicationId, folderId) - - } getFromDB() { const folderId = this.folderId diff --git a/src/app/shared/swiper/swiper.page.ts b/src/app/shared/swiper/swiper.page.ts index 026cde308..ece1a77ae 100644 --- a/src/app/shared/swiper/swiper.page.ts +++ b/src/app/shared/swiper/swiper.page.ts @@ -41,6 +41,7 @@ export class SwiperPage implements OnInit { this.local.find({documentId: this.documentId}).then(async e => { if(e.isOk() && e.value.length == 0) { + console.log('===============================================0') var result = await this.publicationFileGetByDocumentIdService.execute({ documentId: this.documentId, processId: this.processId, @@ -52,6 +53,7 @@ export class SwiperPage implements OnInit { this.makeLoad(); } } else if(e.isOk()) { + console.log('===============================================1') this.publicationList = e.value; this.makeLoad(); @@ -64,7 +66,10 @@ export class SwiperPage implements OnInit { }); if(result.isOk()) { - this.publicationList = result.value.added; + var newList = await this.local.find({documentId: this.documentId}) + if(newList.isOk()) { + this.publicationList = newList.value; + } this.makeLoad(); } }