mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
fix
This commit is contained in:
@@ -9,6 +9,8 @@ import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { Camera, CameraResultType, CameraSource} from '@capacitor/camera';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { PublicationFolderService } from 'src/app/store/publication-folder.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-publication',
|
||||
templateUrl: './new-publication.page.html',
|
||||
@@ -50,7 +52,8 @@ export class NewPublicationPage implements OnInit {
|
||||
private publications: PublicationsService,
|
||||
private toastService: ToastService,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public PublicationFolderService: PublicationFolderService
|
||||
) {
|
||||
this.publicationTitle = 'Nova Publicação';
|
||||
}
|
||||
@@ -65,22 +68,43 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
getPublicationDetail() {
|
||||
this.showLoader = true;
|
||||
this.publications.GetPublicationById(this.publicationId).subscribe( res => {
|
||||
|
||||
|
||||
const folderId = this.folderId
|
||||
const localPublication = this.PublicationFolderService.getLocalPublication(folderId, this.publicationId);
|
||||
|
||||
if(localPublication?.DocumentId) {
|
||||
|
||||
this.publication = {
|
||||
DateIndex: res.DateIndex,
|
||||
DocumentId: res.DocumentId,
|
||||
ProcessId:res.ProcessId,
|
||||
Title:res.Title,
|
||||
Message: res.Message,
|
||||
DatePublication: res.DatePublication,
|
||||
FileBase64: "data:image/jpg;base64," + res.FileBase64,
|
||||
OriginalFileName: res.OriginalFileName,
|
||||
DateIndex: localPublication.DateIndex,
|
||||
DocumentId: localPublication.DocumentId,
|
||||
ProcessId:localPublication.ProcessId,
|
||||
Title:localPublication.Title,
|
||||
Message: localPublication.Message,
|
||||
DatePublication: localPublication.DatePublication,
|
||||
FileBase64: localPublication.FileBase64,
|
||||
OriginalFileName: localPublication.OriginalFileName,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
this.pub = this.publication;
|
||||
this.showLoader = false;
|
||||
});
|
||||
} else {
|
||||
this.showLoader = true;
|
||||
this.publications.GetPublicationById(this.publicationId).subscribe( res => {
|
||||
this.publication = {
|
||||
DateIndex: res.DateIndex,
|
||||
DocumentId: res.DocumentId,
|
||||
ProcessId:res.ProcessId,
|
||||
Title:res.Title,
|
||||
Message: res.Message,
|
||||
DatePublication: res.DatePublication,
|
||||
FileBase64: "data:image/jpg;base64," + res.FileBase64,
|
||||
OriginalFileName: res.OriginalFileName,
|
||||
FileExtension: 'jpeg',
|
||||
}
|
||||
this.pub = this.publication;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -228,6 +252,9 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.PublicationFolderService.loadPublication(this.publication.DocumentId, this.publication.ProcessId)
|
||||
}
|
||||
else {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user