diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index 98e0a9e7f..e2a496b4b 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -76,7 +76,7 @@ export class NewPublicationPage implements OnInit { this.camera.getPicture(options).then((imageData) => { // imageData is either a base64 encoded string or a file URI - // If it's base64 (DATA_URL): + // If it's base64 (DATA_URL): let base64Image = 'data:image/jpeg;base64,' + imageData; this.capturedImage = imageData; this.capturedImageTitle = new Date().getTime() + '.jpeg'; @@ -107,6 +107,8 @@ export class NewPublicationPage implements OnInit { } async save(){ + console.log('SAVE'); + if(this.publicationType == '3'){ console.log(this.navParams.get('publication')); @@ -124,7 +126,7 @@ export class NewPublicationPage implements OnInit { } console.log('Edit change image'); console.log(this.publication); - this.publications.UpdatePublication(this.publication.ProcessId, this.publication); + this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise(); this.close(); } else{ @@ -139,14 +141,13 @@ export class NewPublicationPage implements OnInit { FileBase64: this.publication.FileBase64, FileExtension: 'jpeg', } - /* console.log('Edit - keep image'); - console.log(this.publication); */ - this.publications.UpdatePublication(this.publication.ProcessId, this.publication); + console.log('Edit - keep image'); + console.log(this.publication); + this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise(); this.close(); } } else{ - this.publication = { DateIndex: new Date(), DocumentId:null, @@ -161,7 +162,7 @@ export class NewPublicationPage implements OnInit { /* console.log('Create'); console.log(this.publication); */ - this.publications.CreatePublication(this.folderId, this.publication); + this.publications.CreatePublication(this.folderId, this.publication).toPromise(); this.close(); } }