15 lines
490 B
TypeScript
15 lines
490 B
TypeScript
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.');
|
|
}
|
|
}
|
|
|
|
} |