mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Publication
This commit is contained in:
@@ -210,6 +210,7 @@ export class NewPublicationPage implements OnInit {
|
||||
|
||||
|
||||
if (this.publicationType == '3') {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
// has captured image
|
||||
if (this.capturedImage != '') {
|
||||
@@ -225,20 +226,7 @@ export class NewPublicationPage implements OnInit {
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
|
||||
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
|
||||
console.log({response})
|
||||
|
||||
this.close()
|
||||
} catch (error) {
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
// no file names
|
||||
@@ -255,19 +243,6 @@ export class NewPublicationPage implements OnInit {
|
||||
FileExtension: "",
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Criar publicação')
|
||||
console.log({response})
|
||||
|
||||
this.close()
|
||||
} catch (error) {
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
} else {
|
||||
this.publication = {
|
||||
@@ -281,23 +256,30 @@ export class NewPublicationPage implements OnInit {
|
||||
FileBase64: this.publication.FileBase64,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.httpErrorHandle.httpsSucessMessagge('Publicação Editada')
|
||||
console.log({response})
|
||||
this.close()
|
||||
} catch (error) {
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
const response = await this.publications.CreatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
try {
|
||||
await this.publications.DeletePublication(this.folderId, this.publication.DocumentId).toPromise();
|
||||
} catch(error) {}
|
||||
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar publicação')
|
||||
console.log({response})
|
||||
|
||||
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.httpErrorHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
this.PublicationFolderService.deletePost(this.publication.DocumentId, this.publication.ProcessId)
|
||||
this.PublicationFolderService.deletePost(this.folderId, this.publication.ProcessId)
|
||||
this.PublicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId)
|
||||
|
||||
}
|
||||
else {
|
||||
@@ -336,11 +318,13 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
this.PublicationFolderService.getPublicationsIds(this.folderId)
|
||||
}
|
||||
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss().then(() => {
|
||||
this.modalController.dismiss(this.publication).then(() => {
|
||||
this.showLoader = true;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user