Files
pn-new-crm/src/app/api/v1/berths/options/route.ts

16 lines
500 B
TypeScript
Raw Normal View History

import { NextResponse } from 'next/server';
import { withAuth } from '@/lib/api/helpers';
import { getBerthOptions } from '@/lib/services/berths.service';
import { errorResponse } from '@/lib/errors';
// GET /api/v1/berths/options — lightweight list for selects/comboboxes
export const GET = withAuth(async (req, ctx) => {
try {
const options = await getBerthOptions(ctx.portId);
return NextResponse.json({ data: options });
} catch (error) {
return errorResponse(error);
}
});