This commit is contained in:
Peter Maquiran
2024-04-03 15:28:58 +01:00
parent 00a58e12f4
commit 1671ace745
5 changed files with 41 additions and 14 deletions
@@ -113,11 +113,19 @@ export class PublicationFromMvService {
publication.ProcessId = this.folderId
if(this.form.cancel) {
window['upload-header-set-remove'](this.id);
return false
}
try {
const response = await this.publications.UpdatePublication(publication.ProcessId, publication).toPromise()
this.httpErroHandle.httpsSucessMessagge('Editar publicação')
if (!this.form.cancel) {
this.httpErroHandle.httpsSucessMessagge('Editar publicação')
}
this.publicationFolderService.getPublicationsIds(this.folderId)
window['upload-header-set-remove'](this.id);
@@ -195,21 +203,24 @@ export class PublicationFromMvService {
publication.DocumentId = null;
publication.ProcessId = this.folderId
if(this.form.cancel) {
window['upload-header-set-remove'](this.id);
return false
}
try {
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
if (this.publicationType == '1') {
if (this.publicationType == '1' && !this.form.cancel) {
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
} else if (this.publicationType == '2') {
} else if (this.publicationType == '2' && !this.form.cancel) {
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
} else if (this.publicationType == '3') {
this.httpErroHandle.httpsSucessMessagge('Editar publicação')
}
// this.goBackToViewPublications.emit();
window['upload-header-set-remove'](this.id);
this.closeApp()
this.doneUpload()
this.publicationFolderService.getPublicationsIds(this.folderId)
} catch (error) {
window['upload-header-set-retry'](this.id)
@@ -232,11 +243,14 @@ export class PublicationFromMvService {
}
closeApp() {
doneUpload() {
if (window["sharedContent"]) {
if (this.platform.is('android')) {
App.exitApp()
window["sharedContent"] = null
this.modalController.dismiss(this.form).then(() => {
this.router.navigate(['/home/publications', this.folderId])
});
} else {
window["sharedContent"] = null
this.modalController.dismiss(this.form).then(() => {
@@ -244,6 +258,8 @@ export class PublicationFromMvService {
});
}
} else {
this.modalController.dismiss(this.form).then(() => {});
}
}