mirror of
https://github.com/umami-software/umami.git
synced 2026-02-10 23:57:12 +01:00
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:
parent
4c9b2f10da
commit
af7f7adf5b
5 changed files with 105 additions and 53 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue