mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
list event to approve
This commit is contained in:
@@ -1,12 +1,16 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { AgendaDataService } from './agenda-data.service';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { catchError, 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';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -34,10 +38,11 @@ export class AgendaDataRepositoryService {
|
||||
))
|
||||
}
|
||||
|
||||
eventToApprove({userId, startDate = null, endDate = null, status = 0, category= null, type= null, calendarOwnerName = ''}) {
|
||||
eventToApproveList({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)
|
||||
return EventListToApproveMapper.toDomain(response.data, calendarOwnerName, userId)
|
||||
}
|
||||
))
|
||||
}
|
||||
@@ -109,4 +114,15 @@ export class AgendaDataRepositoryService {
|
||||
console.log(error)
|
||||
}))
|
||||
}
|
||||
|
||||
async deleteEvent1(eventId) {
|
||||
|
||||
try {
|
||||
const result = await this.agendaDataService.deleteEvent(eventId,false).toPromise()
|
||||
return ok (result)
|
||||
} catch (e) {
|
||||
return err(e as HttpErrorResponse)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user