Files
vitrify-me/apps/web/lib/bookingService.ts
2025-08-26 23:36:24 +04:00

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.');
}
}
}