mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
Merge branch 'feature/agenda-new-api-peter' into feature/agenda-new-api-eudes
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AgendaDataService } from './agenda-data.service';
|
||||
import { catchError, map } from 'rxjs/operators';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ListEventMapper } from './mapper/EventListMapper';
|
||||
import { EventMapper } from './mapper/EventDetailsMapper';
|
||||
import { Utils } from './utils';
|
||||
import { EventInputDTO } from './agendaDataModels';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { EventListToApproveMapper } from './mapper/eventToApproveListMapper';
|
||||
import { err, ok } from 'neverthrow';
|
||||
import { of } from 'rxjs';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { EventToApproveDetailsMapper } from './mapper/EventToApproveDetailsMapper';
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ export class EventToApproveDetailsMapper {
|
||||
// "OriginatorComments": "",
|
||||
"Status": "Active",
|
||||
//"TimeZone": "",
|
||||
"Agenda": "Oficial",
|
||||
"Agenda": category ,
|
||||
"EventType": "Reunião",
|
||||
//"EventID": "",
|
||||
//"HasAttachments": true,
|
||||
|
||||
@@ -26,12 +26,13 @@ export class EventListToApproveMapper {
|
||||
if(dto.ownerType == 'PR') {
|
||||
color = 'PR'
|
||||
workflowDisplayName = `Agenda ${category} ${color}`
|
||||
} else if(dto.ownerType == 'MD') {
|
||||
} else {
|
||||
color = 'MDGPR'
|
||||
workflowDisplayName = `Agenda ${category} ${color}`
|
||||
} else {
|
||||
workflowDisplayName = `Agenda ${category}`
|
||||
}
|
||||
// else {
|
||||
// workflowDisplayName = `Agenda ${category}`
|
||||
// }
|
||||
|
||||
return {
|
||||
serialNumber: dto.id,
|
||||
|
||||
@@ -47,7 +47,7 @@ export const EventOutputDTOSchema = z.object({
|
||||
startDate: z.string(),
|
||||
endDate: z.string(),
|
||||
type: z.string(),
|
||||
category: z.string(),
|
||||
category: z.enum(['Oficial','Pessoal']),
|
||||
attendees: z.array(AttendeeSchema),
|
||||
isRecurring: z.boolean(),
|
||||
eventRecurrence: z.null(),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { HttpClient, HttpHeaderResponse, HttpHeaders } from '@angular/common/http';
|
||||
import { HttpClient, HttpErrorResponse, HttpHeaderResponse, HttpHeaders } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ok, err } from 'neverthrow';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
@@ -9,16 +10,19 @@ export class HttpService {
|
||||
|
||||
constructor(private http:HttpClient) { }
|
||||
|
||||
post(serviceName:string, data:any){
|
||||
const headers = new HttpHeaders();;
|
||||
const options = {header: headers, withCredentials: false};
|
||||
async post(serviceName:string, data:any) {
|
||||
const headers = new HttpHeaders();
|
||||
const url = environment.apiChatUrl+serviceName;
|
||||
const body = {"user": "admin","password": "tabteste@006"};
|
||||
|
||||
return this.http.post(url, /* JSON.stringify( */data/* ), options */)
|
||||
try {
|
||||
const result = await this.http.post(url, {}).toPromise()
|
||||
return ok (result)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
get(serviceName:string, options:any){
|
||||
async get(serviceName:string, options:any) {
|
||||
const url = environment.apiChatUrl+serviceName;
|
||||
return this.http.get(url, options);
|
||||
}
|
||||
|
||||
@@ -83,21 +83,21 @@ export class ProcessesService {
|
||||
return this.http.get<fullTaskList[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
eventsToApprove(userid, caller) {
|
||||
const geturl = environment.apiURL + 'tasks/events-to-approve';
|
||||
let params = new HttpParams();
|
||||
// eventsToApprove(userid, caller) {
|
||||
// const geturl = environment.apiURL + 'tasks/events-to-approve';
|
||||
// let params = new HttpParams();
|
||||
|
||||
params = params.set("pageNum", 1);
|
||||
params = params.set("pageSize", 500);
|
||||
params = params.set("userid", userid);
|
||||
// params = params.set("pageNum", 1);
|
||||
// params = params.set("pageSize", 500);
|
||||
// params = params.set("userid", userid);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
// let options = {
|
||||
// headers: this.headers,
|
||||
// params: params
|
||||
// };
|
||||
|
||||
return this.http.get<fullTaskList[]>(`${geturl}`, options);
|
||||
}
|
||||
// return this.http.get<fullTaskList[]>(`${geturl}`, options);
|
||||
// }
|
||||
|
||||
GetTaskListExpediente(onlycount1): Observable<ExpedienteFullTask[]> {
|
||||
const processname = "Expediente"
|
||||
|
||||
Reference in New Issue
Block a user