mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
fix actions and draft data object
This commit is contained in:
@@ -12,6 +12,26 @@ import { SearchPage } from 'src/app/pages/search/search.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 { z } from "zod";
|
||||
|
||||
|
||||
const Bodyschema = z.object({
|
||||
SerialNumber: z.string(),
|
||||
DispatchDocId: z.number(),
|
||||
FolderID: z.any(),
|
||||
Subject: z.string(),
|
||||
Comment: z.string().optional(),
|
||||
DelegatedUserEmail: z.string().email(),
|
||||
UserId: z.any(),
|
||||
DraftIds: z.string(),
|
||||
})
|
||||
|
||||
|
||||
const ProsSchema = z.object({
|
||||
DraftIds: z.string(),
|
||||
})
|
||||
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-delegar',
|
||||
@@ -64,6 +84,19 @@ export class DelegarPage implements OnInit {
|
||||
/* this.postData.EndDate = new Date(selectedEndDate.setMinutes(new Date().getMinutes() + 30)); */
|
||||
|
||||
this.hideThisFeature = this.navParams.get('showAttachmentBtn');
|
||||
|
||||
|
||||
const result = ProsSchema.safeParse(this.task);
|
||||
|
||||
if(!result.success) {
|
||||
console.log(result)
|
||||
console.log("result")
|
||||
console.log(result["error"])
|
||||
} else {
|
||||
console.log(result.data)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -86,6 +119,7 @@ export class DelegarPage implements OnInit {
|
||||
else if(this.taskParticipants.length > 1){
|
||||
this.toastService._badRequest("Selecione apenas um destinatário");
|
||||
}
|
||||
|
||||
else {
|
||||
let body = {
|
||||
"SerialNumber": this.task.SerialNumber,
|
||||
@@ -94,8 +128,11 @@ export class DelegarPage implements OnInit {
|
||||
"Subject": this.task.Folio,
|
||||
"Comment": this.note,
|
||||
"DelegatedUserEmail": this.taskParticipants[0].EmailAddress,
|
||||
"DraftIds": this.task.DraftIds,
|
||||
"UserId": this.taskParticipants[0].Id
|
||||
}
|
||||
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
this.processes.DelegateTask(body).subscribe(res=>{
|
||||
|
||||
Reference in New Issue
Block a user