- Added city, state, and country optional fields to Complex model - Updated onboarding to include optional location fields - Created new settings page with sidebar navigation (Datos del Complejo, Canchas) - Replaced ESLint with Biome for frontend and backend linting - Added parallel dev script with concurrently - Migrated register-routes to use direct app.route() pattern
25 lines
814 B
TypeScript
25 lines
814 B
TypeScript
import {
|
|
AdminBookingServiceError,
|
|
listAdminBookings,
|
|
} from '@/modules/admin-booking/services/admin-booking.service';
|
|
import type { AppContext } from '@/types/hono';
|
|
import type { ListAdminBookingsQuery } from '@repo/api-contract';
|
|
|
|
type ComplexIdParams = { complexId: string };
|
|
|
|
export async function listAdminBookingsHandler(c: AppContext) {
|
|
const { complexId } = c.req.valid('param' as never) as ComplexIdParams;
|
|
const query = c.req.valid('query' as never) as ListAdminBookingsQuery;
|
|
const appUserId = c.get('appUserId');
|
|
|
|
try {
|
|
const response = await listAdminBookings(appUserId, complexId, query);
|
|
return c.json(response);
|
|
} catch (error) {
|
|
if (error instanceof AdminBookingServiceError) {
|
|
return c.json({ message: error.message }, error.status);
|
|
}
|
|
throw error;
|
|
}
|
|
}
|