fix update bug

This commit is contained in:
Peter Maquiran
2024-04-12 14:25:09 +01:00
parent 73a8885435
commit d72365cb41
3 changed files with 11 additions and 20 deletions
@@ -90,6 +90,10 @@ export class PublicationsPage implements OnInit {
window['goToPublicationsList'] = this.goToPublicationsList window['goToPublicationsList'] = this.goToPublicationsList
window['updateAction'] = () => {
this.getActions()
}
} }
@@ -180,7 +184,7 @@ export class PublicationsPage implements OnInit {
} }
getActions() { getActions = () => {
this.showLoader = true this.showLoader = true
this.publications.GetPublicationFolderList().subscribe(async res => { this.publications.GetPublicationFolderList().subscribe(async res => {
@@ -193,24 +197,6 @@ export class PublicationsPage implements OnInit {
this.showLoader = false; this.showLoader = false;
// (async ()=> {
// const created = await ActionModel.create(folders)
// const stored = await ActionModel.all()
// const notPresentOnTheRequest: ActionModel[] = stored.filter(e => {
// return !folders.find(b => e.ProcessId == b.ProcessId)
// })
// for (let ActionModelToDelete of notPresentOnTheRequest) {
// ActionModelToDelete.delete()
// }
// // console.log({created, stored, folders, toDeletes})
// })()
}, (error) => { }, (error) => {
this.showLoader = false; this.showLoader = false;
this.getFromDB() this.getFromDB()
@@ -284,10 +284,15 @@ export class ViewPublicationsPage implements OnInit {
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
if (res.data == 'Yes') { if (res.data == 'Yes') {
const loader = this.toastService.loading(); const loader = this.toastService.loading();
try { try {
this.publications.DeletePresidentialAction(folderId).toPromise(); this.publications.DeletePresidentialAction(folderId).toPromise();
this.httpErrorHandle.httpsSucessMessagge('Eliminar Acção') this.httpErrorHandle.httpsSucessMessagge('Eliminar Acção')
setTimeout(()=> {
window['updateAction']()
}, 1500)
} catch (error) { } catch (error) {
this.httpErrorHandle.httpStatusHandle(error) this.httpErrorHandle.httpStatusHandle(error)
} }
+1 -1
View File
@@ -4,4 +4,4 @@ import { environment as oaprProd } from './suport/oapr'
import { DevDev } from './suport/dev' import { DevDev } from './suport/dev'
export const environment: Environment = DevDev; export const environment: Environment = oaprProd;