This commit is contained in:
Peter Maquiran
2021-06-30 12:03:28 +01:00
17 changed files with 70 additions and 157 deletions
@@ -78,7 +78,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';
@@ -109,7 +109,9 @@ export class NewPublicationPage implements OnInit {
}
async save(){
if(this.publicationType == '3') {
console.log('SAVE');
if(this.publicationType == '3'){
console.log(this.navParams.get('publication'));
if(this.capturedImage != '') {
@@ -164,7 +166,6 @@ export class NewPublicationPage implements OnInit {
}
}
else{
this.publication = {
DateIndex: new Date(),
DocumentId:null,
@@ -179,7 +180,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();
@@ -207,13 +208,13 @@ export class NewPublicationPage implements OnInit {
this.capturedImage = '';
}
setTitle(){
if(this.publicationType == '1'){
if(this.publicationType == '1') {
this.publicationTitle = 'Nova Publicação Rápida';
}
else if(this.publicationType == '2'){
else if(this.publicationType == '2') {
this.publicationTitle = 'Nova Publicação';
}
else if(this.publicationType == '3'){
else if(this.publicationType == '3') {
this.publicationTitle = 'Editar Publicação';
this.pub = this.navParams.get('publication');
}