mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
add endpoint to get sharedCalendar
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Observable } from 'rxjs';
|
||||
import { EventOutputDTO } from './model/eventDTOOutput';
|
||||
import { EventInputDTO } from './model/eventInputDTO';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { SharedCalendarListOutputDTO, SharedCalendarListOutputDTOSchema } from './model/sharedCalendarOutputDTO';
|
||||
import { HttpService } from '../../http.service';
|
||||
import { APIReturn } from '../../decorator/api-validate-schema.decorator';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
@@ -11,7 +14,10 @@ import { EventInputDTO } from './model/eventInputDTO';
|
||||
export class AgendaDataService {
|
||||
private baseUrl = 'https://gdapi-dev.dyndns.info/stage/api/v2'; // Your base URL
|
||||
|
||||
constructor(private http: HttpClient) { }
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
private httpService: HttpService
|
||||
) { }
|
||||
|
||||
getContacts(value: string): Observable<any> {
|
||||
const params = new HttpParams().set('value', value);
|
||||
@@ -115,4 +121,10 @@ export class AgendaDataService {
|
||||
.set('PageSize', PageSize);
|
||||
return this.http.get<any>(`${this.baseUrl}/Documents/Attachments${aplicationId}`, {params});
|
||||
}
|
||||
|
||||
|
||||
@APIReturn(SharedCalendarListOutputDTOSchema)
|
||||
async getSharedCalendar() {
|
||||
return await this.httpService.get<SharedCalendarListOutputDTO>(`${this.baseUrl}/Users/id/ShareCalendar?id=${SessionStore.user.UserId}`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user