feat(api): yacht detail, patch, archive, transfer, history, autocomplete

This commit is contained in:
Matt Ciaccio
2026-04-24 12:40:51 +02:00
parent a5036c6358
commit 90463269ce
6 changed files with 472 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
import { NextResponse } from 'next/server';
import { withAuth, withPermission, type RouteHandler } from '@/lib/api/helpers';
import { errorResponse } from '@/lib/errors';
import { listOwnershipHistory } from '@/lib/services/yachts.service';
export const historyHandler: RouteHandler = async (req, ctx, params) => {
try {
const history = await listOwnershipHistory(params.id!, ctx.portId);
return NextResponse.json({ data: history });
} catch (error) {
return errorResponse(error);
}
};
export const GET = withAuth(withPermission('yachts', 'view', historyHandler));