basic booking load behavior
This commit is contained in:
@@ -12,7 +12,7 @@ import { inject, Injectable } from "@angular/core";
|
||||
import { Observable } from "rxjs";
|
||||
import { BASE_PATH_DEFAULT, CLIENT_CONTEXT_TOKEN_DEFAULT } from "../tokens";
|
||||
import { HttpParamsBuilder } from "../utils/http-params-builder";
|
||||
import { RequestOptions, CreateEventDto, CreateExceptionDto, CalendarCreateBookingDto, CancelBookingDto } from "../models";
|
||||
import { RequestOptions, CreateEventDto, CreateExceptionDto, CalendarCreateBookingDto, CancelBookingDto, CalenderControllerGetBookingResponse } from "../models";
|
||||
|
||||
@Injectable({ providedIn: "root" })
|
||||
export class CalendarService {
|
||||
@@ -153,14 +153,32 @@ export class CalendarService {
|
||||
return this.httpClient.patch(url, cancelBookingDto, requestOptions);
|
||||
}
|
||||
|
||||
calendarControllerGetBookings(eventId: number, startTime: Date, observe?: 'body', options?: RequestOptions<'json'>): Observable<any>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: Date, observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<any>>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: Date, observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<any>>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: Date, observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/bookings/${eventId}/${startTime}`;
|
||||
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'body', options?: RequestOptions<'json'>): Observable<CalenderControllerGetBookingResponse>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'response', options?: RequestOptions<'json'>): Observable<HttpResponse<CalenderControllerGetBookingResponse>>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'events', options?: RequestOptions<'json'>): Observable<HttpEvent<CalenderControllerGetBookingResponse>>;
|
||||
calendarControllerGetBookings(eventId: number, startTime: string, page?: number, limit?: number, sortBy?: string, order?: 'ASC' | 'DESC', observe?: 'body' | 'events' | 'response', options?: RequestOptions<'arraybuffer' | 'blob' | 'json' | 'text'>): Observable<any> {
|
||||
const url = `${this.basePath}/api/calendar/bookings/${eventId}`;
|
||||
|
||||
let params = new HttpParams();
|
||||
if (page != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, page, 'page');
|
||||
}
|
||||
if (limit != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, limit, 'limit');
|
||||
}
|
||||
if (sortBy != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, sortBy, 'sortBy');
|
||||
}
|
||||
if (order != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, order, 'order');
|
||||
}
|
||||
if (startTime != null) {
|
||||
params = HttpParamsBuilder.addToHttpParams(params, startTime, 'startTime');
|
||||
}
|
||||
|
||||
const requestOptions: any = {
|
||||
observe: observe as any,
|
||||
params,
|
||||
reportProgress: options?.reportProgress,
|
||||
withCredentials: options?.withCredentials,
|
||||
context: this.createContextWithClientId(options?.context)
|
||||
|
||||
Reference in New Issue
Block a user