mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
remove calendar id
This commit is contained in:
@@ -53,7 +53,8 @@ export class AgendaDataRepositoryService {
|
||||
|
||||
}
|
||||
|
||||
async EventList({userId = null, startDate = null, endDate = null, status= 2, category= null, type= null, calendarOwnerName = ''}) {
|
||||
async EventList({userId, startDate , endDate , status= 2, category= null, type= null, calendarOwnerName = ''}) {
|
||||
|
||||
try {
|
||||
const result = await this.agendaDataService.getEvents(userId, startDate, endDate, status, category, type).pipe(
|
||||
map((response) => {
|
||||
@@ -177,6 +178,19 @@ export class AgendaDataRepositoryService {
|
||||
if(result.isOk()) {
|
||||
await this.agendaLocalDataSourceService.clearSharedCalendar()
|
||||
if(result.value?.data) {
|
||||
|
||||
const currentUserCalendar = {
|
||||
wxUserId: SessionStore.user.UserId,
|
||||
wxFullName: SessionStore.user.FullName,
|
||||
wxeMail: SessionStore.user.Email,
|
||||
role: SessionStore.user.RoleDescription,
|
||||
roleId: SessionStore.user.RoleID,
|
||||
shareType: 0,
|
||||
date: '',
|
||||
}
|
||||
|
||||
result.value.data.push(currentUserCalendar)
|
||||
|
||||
return await this.agendaLocalDataSourceService.bulkCreate(result.value.data)
|
||||
} else {
|
||||
return result
|
||||
|
||||
@@ -41,7 +41,7 @@ export class AgendaDataService {
|
||||
}
|
||||
|
||||
// Events Endpoints
|
||||
createEvent(eventData: EventInputDTO): Observable<any> {
|
||||
createEvent(eventData: EventInputDTO) {
|
||||
return this.http.post<any>(`${this.baseUrl}/Events`, eventData);
|
||||
}
|
||||
|
||||
@@ -50,6 +50,10 @@ export class AgendaDataService {
|
||||
.set('UserId', userId)
|
||||
.set('Status', status)
|
||||
|
||||
if(userId == null || userId == undefined) {
|
||||
throw('userId '+ userId)
|
||||
}
|
||||
|
||||
if (startDate !== null && startDate !== undefined) {
|
||||
params = params.set('startDate', startDate);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ export function APIReturn(schema: z.ZodTypeAny) {
|
||||
Sentry.captureException(error);
|
||||
});
|
||||
console.error('Validation failed:', error.errors);
|
||||
|
||||
} else {
|
||||
console.log('failed to setup the connection successful')
|
||||
// Throw any other unexpected errors
|
||||
|
||||
@@ -11,6 +11,7 @@ import { catchError } from "rxjs/operators";
|
||||
import { SessionStore } from '../store/session.service';
|
||||
import { calendarInterface } from '../models/user.model';
|
||||
import { Subscribe } from './subcribe';
|
||||
import { EventOutputDTO } from './Repositorys/Agenda/model/eventDTOOutput';
|
||||
|
||||
|
||||
@Injectable({
|
||||
@@ -418,19 +419,8 @@ export class EventsService {
|
||||
|
||||
isMyEvent(event: any) {
|
||||
|
||||
for (let calendar of SessionStore.user.OwnerCalendars) {
|
||||
if(event.CalendarId == calendar.CalendarId) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
for (let sharedCalendar of SessionStore.user.SharedCalendars) {
|
||||
if(event.CalendarId == sharedCalendar.CalendarId) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
const data: any = event
|
||||
return data.Organizer.Id == SessionStore.user.UserId
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user