implement website share functionality using share table

- Add support for multiple share URLs per website with server-generated slugs
- Create shares API endpoint for listing and creating website shares
- Add SharesTable, ShareEditButton, ShareDeleteButton components
- Move share management to website settings, remove header share button
- Remove shareId from website update API (now uses separate share table)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mike CaoandClaude Opus 4.5 committed 2026-01-20 17:23:14 -08:00
1 parent 3a498333a6
commit 0eb598c817
13 files changed
+374 -127

No files matched your search

+3 -2
View File
@@ -1,5 +1,6 @@
import z from 'zod';
import { uuid } from '@/lib/crypto';
import { getRandomChars } from '@/lib/generate';
import { parseRequest } from '@/lib/request';
import { json, unauthorized } from '@/lib/response';
import { anyObjectParam } from '@/lib/schema';
@@ -10,7 +11,7 @@ export async function POST(request: Request) {
const schema = z.object({
entityId: z.uuid(),
shareType: z.coerce.number().int(),
slug: z.string().max(100),
slug: z.string().max(100).optional(),
parameters: anyObjectParam,
});
@@ -30,7 +31,7 @@ export async function POST(request: Request) {
id: uuid(),
entityId,
shareType,
slug,
slug: slug || getRandomChars(16),
parameters,
});