timeslots API
This commit is contained in:
15
apps/web/lib/bookingService.ts
Normal file
15
apps/web/lib/bookingService.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { bookingApi } from './pocketbase';
|
||||
import { BookingType } from '@/types/bookings';
|
||||
|
||||
export class BookingService {
|
||||
static async getBookingTypes(): Promise<BookingType[]> {
|
||||
try {
|
||||
const bookingTypes = await bookingApi.getBookingTypes();
|
||||
return bookingTypes.filter(type => type.is_active);
|
||||
} catch (error) {
|
||||
console.error('Failed to fetch booking types:', error);
|
||||
throw new Error('Unable to load booking options. Please try again later.');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user