merge branch

This commit is contained in:
Peter Maquiran
2023-08-28 17:06:16 +01:00
parent 1b897e9c2b
commit a426fba4b3
19 changed files with 176 additions and 136 deletions
@@ -10,7 +10,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
import { ThemeService } from 'src/app/services/theme.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { TaskService } from 'src/app/services/task.service';
import { TaskService } from 'src/app/services/task.service'
@Component({
@@ -109,6 +109,7 @@ export class ApproveEventPage implements OnInit {
async rejectTask(serialNumber:string) {
let body = { "serialNumber": serialNumber, "action": "Descartar" }
const loader = this.toastService.loading()
@@ -132,6 +133,8 @@ export class ApproveEventPage implements OnInit {
} catch (error) {
console.error('getAttchaments',error)
}
}
async viewDocument(DocId:string, Document) {
@@ -193,33 +196,26 @@ export class ApproveEventPage implements OnInit {
if(res.data.option == 'save') {
if(res.data.note !== '') {
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewUserComment": res.data,
}
}
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
this.httpErroHandle.httpsSucessMessagge('Rever')
this.TaskService.loadEventosParaAprovacao();
this.close();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
}
else {
if(res.data.option == 'save') {
this.toastService._badRequest('É necessário adicionar uma nota');
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewUserComment": res.data,
}
}
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
this.httpErroHandle.httpsSucessMessagge('Rever')
this.TaskService.loadEventosParaAprovacao();
this.close();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
} else {