fix: allow visibility-only setup updates without name
All checks were successful
CI / ci (push) Successful in 1m24s
CI / e2e (push) Has been skipped
CI / deploy (push) Successful in 14s

updateSetupSchema required name as mandatory, causing ZodError when
ShareModal sent visibility-only updates. Made name optional in update
schema and guarded against setting undefined name in service layer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-13 18:43:10 +02:00
parent 8d7a668da4
commit e21e1ec523
2 changed files with 4 additions and 2 deletions

View File

@@ -183,9 +183,11 @@ export async function updateSetup(
if (!existing) return null;
const updateData: Record<string, unknown> = {
name: data.name,
updatedAt: new Date(),
};
if (data.name !== undefined) {
updateData.name = data.name;
}
if (data.visibility !== undefined) {
updateData.visibility = data.visibility;
}

View File

@@ -96,7 +96,7 @@ export const createSetupSchema = z.object({
});
export const updateSetupSchema = z.object({
name: z.string().min(1, "Setup name is required"),
name: z.string().min(1, "Setup name is required").optional(),
visibility: z.enum(["private", "link", "public"]).optional(),
});