Add name field to share feature and require at least one item selection.

- Add name field to ShareCreateForm and ShareEditForm
- Add name column to SharesTable
- Update API routes to handle name field
- Require at least one item to be selected before saving
- Display parameters in responsive 3-column grid in edit form

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mike Cao 2026-01-22 20:17:45 -08:00
parent 4c9b2f10da
commit af7f7adf5b
5 changed files with 105 additions and 53 deletions

View file

@ -44,6 +44,7 @@ export async function POST(
{ params }: { params: Promise<{ websiteId: string }> },
) {
const schema = z.object({
name: z.string().max(200),
parameters: anyObjectParam.optional(),
});
@ -54,7 +55,8 @@ export async function POST(
}
const { websiteId } = await params;
const { parameters = {} } = body;
const { name, parameters } = body;
const shareParameters = parameters ?? {};
if (!(await canUpdateWebsite(auth, websiteId))) {
return unauthorized();
@ -66,8 +68,9 @@ export async function POST(
id: uuid(),
entityId: websiteId,
shareType: ENTITY_TYPE.website,
name,
slug,
parameters,
parameters: shareParameters,
});
return json(share);