mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
fix duplication events
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
import { EventOutputDTO } from "../model/eventDTOOutput"
|
||||
|
||||
function getTextInsideParentheses(inputString) {
|
||||
var startIndex = inputString.indexOf('(');
|
||||
var endIndex = inputString.indexOf(')');
|
||||
if (startIndex !== -1 && endIndex !== -1) {
|
||||
return inputString.substring(startIndex + 1, endIndex);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export class EventMapper {
|
||||
|
||||
constructor() {}
|
||||
@@ -25,9 +35,10 @@ export class EventMapper {
|
||||
EmailAddress: e.emailAddress,
|
||||
Name: e.name,
|
||||
IsRequired: e.attendeeType == '0' ? true : false,
|
||||
//IsRequired: e.attendeeType == 'Acknowledgment',
|
||||
UserType: "GD",
|
||||
// "IsPR": false,
|
||||
Acknowledgment: e.attendeeType == '0' ? true : false,
|
||||
// Acknowledgment: e.attendeeType == '0' ? true : false,
|
||||
// "RoleDescription": null,
|
||||
// "RoleId": 0
|
||||
})),
|
||||
@@ -35,7 +46,7 @@ export class EventMapper {
|
||||
"IsRecurring": dto.isRecurring,
|
||||
"IsAllDayEvent": dto.isAllDayEvent,
|
||||
"AppointmentState": 1,
|
||||
"TimeZone": "UTC",
|
||||
"TimeZone": getTextInsideParentheses(new Date(dto.startDate)+ ''),
|
||||
"Organizer": {
|
||||
"Id": dto.organizer.wxUserId,
|
||||
"EmailAddress": dto.organizer.wxeMail,
|
||||
|
||||
@@ -1,6 +1,17 @@
|
||||
import { EventToApproveDetails } from "src/app/models/entiry/agenda/eventToApproveDetails"
|
||||
import { EventOutputDTO } from "../model/eventDTOOutput"
|
||||
|
||||
function getTextInsideParentheses(inputString) {
|
||||
var startIndex = inputString.indexOf('(');
|
||||
var endIndex = inputString.indexOf(')');
|
||||
if (startIndex !== -1 && endIndex !== -1) {
|
||||
return inputString.substring(startIndex + 1, endIndex);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export class EventToApproveDetailsMapper {
|
||||
|
||||
constructor() {}
|
||||
@@ -63,7 +74,7 @@ export class EventToApproveDetailsMapper {
|
||||
// "MDEmail": "evilarinho@gabinetedigital.local",
|
||||
// "OriginatorComments": "",
|
||||
"Status": "Active",
|
||||
//"TimeZone": "",
|
||||
"TimeZone": getTextInsideParentheses(new Date(dto.startDate)+ ''),
|
||||
"Agenda": category ,
|
||||
"EventType": "Reunião",
|
||||
//"EventID": "",
|
||||
|
||||
@@ -47,7 +47,7 @@ export class EventListToApproveMapper {
|
||||
Agenda: dto.category,
|
||||
EndDate: dto.endDate,
|
||||
StartDate: dto.startDate,
|
||||
Subject: dto.body,
|
||||
Subject: dto.subject,
|
||||
Location: dto.location,
|
||||
Status: dto.status,
|
||||
IsAllDayEvent: dto.isAllDayEvent,
|
||||
|
||||
@@ -18,7 +18,7 @@ const CommentSchema = z.object({
|
||||
const AttendeeSchema = z.object({
|
||||
id: z.string(),
|
||||
name: z.string(),
|
||||
attendeeType: EAttendeeTypeDTO,
|
||||
attendeeType: z.enum(["0", "1", "2"]),
|
||||
emailAddress: z.string(),
|
||||
wxUserId: z.number(),
|
||||
});
|
||||
|
||||
@@ -75,6 +75,8 @@ export class ListBoxService {
|
||||
// daysObject[day] = object[day]
|
||||
// }
|
||||
|
||||
console.log('newStracture', newStracture)
|
||||
|
||||
return this.display(newStracture, selectedDate).year
|
||||
|
||||
// const daysStringNum = Object.keys(daysObject)
|
||||
@@ -116,7 +118,6 @@ export class ListBoxService {
|
||||
event['manyDays'] = !this.dateService.isSameDate(event.start, event.end)
|
||||
event['todayOnly'] = this.dateService.isSameDate(event.start, event.end)
|
||||
|
||||
|
||||
if(!days.hasOwnProperty(day)) {
|
||||
days[day] = []
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { HttpClient, HttpErrorResponse, HttpHeaderResponse, HttpHeaders } from '@angular/common/http';
|
||||
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ok, err } from 'neverthrow';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ok, err, Result } from 'neverthrow';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -10,21 +9,43 @@ export class HttpService {
|
||||
|
||||
constructor(private http:HttpClient) { }
|
||||
|
||||
async post(serviceName:string, data:any) {
|
||||
const headers = new HttpHeaders();
|
||||
const url = environment.apiChatUrl+serviceName;
|
||||
async post<T>(url: string, body: any): Promise<Result<T, HttpErrorResponse>> {
|
||||
|
||||
try {
|
||||
const result = await this.http.post(url, {}).toPromise()
|
||||
return ok (result)
|
||||
const result = await this.http.post(url, body).toPromise()
|
||||
return ok (result as T)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
async get(serviceName:string, options:any) {
|
||||
const url = environment.apiChatUrl+serviceName;
|
||||
return this.http.get(url, options);
|
||||
async get<T>(url: string): Promise<Result<T, HttpErrorResponse>> {
|
||||
try {
|
||||
const result = await this.http.get<T>(url).toPromise()
|
||||
return ok (result as T)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
}
|
||||
|
||||
async put<T>(url: string, body: any): Promise<Result<T, HttpErrorResponse>> {
|
||||
|
||||
try {
|
||||
const result = await this.http.put<T>(url, body).toPromise()
|
||||
return ok (result as T)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async delete<T>(url: string): Promise<Result<T, HttpErrorResponse>> {
|
||||
|
||||
try {
|
||||
const result = await this.http.delete<T>(url).toPromise()
|
||||
return ok (result as T)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user