mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Publication
This commit is contained in:
@@ -167,6 +167,7 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
if(this.publicationType == '3') {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
if(this.capturedImage != '') {
|
||||
|
||||
@@ -181,23 +182,6 @@ export class NewPublicationPage implements OnInit {
|
||||
FileBase64: this.capturedImage,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
|
||||
console.log({response})
|
||||
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
else if (!this.PublicationFolderService.PublicationHasImage(this.publication)) { //
|
||||
|
||||
@@ -212,21 +196,6 @@ export class NewPublicationPage implements OnInit {
|
||||
FileBase64: "",
|
||||
FileExtension: this.publication.FileExtension,
|
||||
}
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
|
||||
const response = await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
|
||||
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
|
||||
console.log({response})
|
||||
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
} else {
|
||||
this.publication = {
|
||||
@@ -241,28 +210,29 @@ 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.httpErroHandle.httpsSucessMessagge('Criar publicação')
|
||||
|
||||
console.log({response})
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.httpErroHandle.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.httpErroHandle.httpsSucessMessagge('Editar publicação')
|
||||
console.log({response})
|
||||
|
||||
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
this.PublicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId)
|
||||
this.PublicationFolderService.deletePost(this.publication.DocumentId, this.publication.ProcessId)
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user