- 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
829 B
TypeScript
25 lines
829 B
TypeScript
import {
|
|
AdminBookingServiceError,
|
|
updateAdminBookingStatus,
|
|
} from '@/modules/admin-booking/services/admin-booking.service';
|
|
import type { AppContext } from '@/types/hono';
|
|
import type { UpdateAdminBookingStatusInput } from '@repo/api-contract';
|
|
|
|
type BookingIdParams = { id: string };
|
|
|
|
export async function updateAdminBookingStatusHandler(c: AppContext) {
|
|
const { id } = c.req.valid('param' as never) as BookingIdParams;
|
|
const payload = c.req.valid('json' as never) as UpdateAdminBookingStatusInput;
|
|
const appUserId = c.get('appUserId');
|
|
|
|
try {
|
|
const booking = await updateAdminBookingStatus(appUserId, id, payload);
|
|
return c.json(booking);
|
|
} catch (error) {
|
|
if (error instanceof AdminBookingServiceError) {
|
|
return c.json({ message: error.message }, error.status);
|
|
}
|
|
throw error;
|
|
}
|
|
}
|