mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
list events
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AgendaDataService } from './agenda-data.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { ListEventMapper } from './mapper/EventListMapper';
|
||||
import { EventMapper } from './mapper/EventDetailsMapper';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AgendaDataRepositoryService {
|
||||
|
||||
constructor(
|
||||
private agendaDataService: AgendaDataService
|
||||
) {}
|
||||
|
||||
createEvent(eventData: any) {
|
||||
return this.agendaDataService.createEvent(eventData).pipe(map(EventMapper.toDomain))
|
||||
}
|
||||
|
||||
getEventById(id: string) {
|
||||
return this.agendaDataService.getEvent(id).pipe(
|
||||
map((response) => {
|
||||
return EventMapper.toDomain(response.data)
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
EventList({userId = null, startDate = null, endDate = null, status= 2, category= null, type= null, calendarOwnerName = ''}) {
|
||||
return this.agendaDataService.getEvents(userId, startDate, endDate, status, category, type).pipe(
|
||||
map((response) => {
|
||||
return ListEventMapper.toDomain(response.data, calendarOwnerName, userId)
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
eventToApprove({userId, startDate = null, endDate = null, status = 0, category= null, type= null, calendarOwnerName = ''}) {
|
||||
return this.agendaDataService.getEvents(userId, startDate = null, endDate = null, status, category= null, type= null).pipe(
|
||||
map((response) => {
|
||||
return ListEventMapper.toDomain(response.data, calendarOwnerName, userId)
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user