mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Improve loader
This commit is contained in:
@@ -164,6 +164,8 @@ export class NewPublicationPage implements OnInit {
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
console.log(this.publication);
|
||||
|
||||
@@ -173,6 +175,8 @@ export class NewPublicationPage implements OnInit {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -190,6 +194,9 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
/* console.log('Edit - keep image');
|
||||
console.log(this.publication); */
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
console.log(this.publication);
|
||||
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
|
||||
@@ -198,6 +205,8 @@ export class NewPublicationPage implements OnInit {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -215,6 +224,8 @@ export class NewPublicationPage implements OnInit {
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
console.log(this.publication);
|
||||
await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
|
||||
@@ -225,6 +236,8 @@ export class NewPublicationPage implements OnInit {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest("Publicação não criado")
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user