Initial commit

This commit is contained in:
Jarek Krochmalski
2025-12-28 21:16:03 +01:00
commit 62e3c6439e
552 changed files with 104858 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { setDefaultRegistry, getRegistry } from '$lib/server/db';
export const POST: RequestHandler = async ({ params }) => {
try {
const id = parseInt(params.id);
if (isNaN(id)) {
return json({ error: 'Invalid registry ID' }, { status: 400 });
}
const registry = await getRegistry(id);
if (!registry) {
return json({ error: 'Registry not found' }, { status: 404 });
}
await setDefaultRegistry(id);
return json({ success: true });
} catch (error) {
console.error('Error setting default registry:', error);
return json({ error: 'Failed to set default registry' }, { status: 500 });
}
};