Update create flow pages

This commit is contained in:
adilallo
2026-04-13 18:24:13 -06:00
parent a39b4aa04b
commit a0de78c020
66 changed files with 1028 additions and 538 deletions
+14 -5
View File
@@ -50,11 +50,20 @@ export function buildPublishPayload(
return { ok: false, error: "missingCommunityName" };
}
let summary: string | undefined;
if (typeof state.summary === "string") {
const t = state.summary.trim();
if (t.length > 0) summary = t;
}
const firstNonEmpty = (...candidates: unknown[]): string | undefined => {
for (const c of candidates) {
if (typeof c !== "string") continue;
const t = c.trim();
if (t.length > 0) return t;
}
return undefined;
};
let summary = firstNonEmpty(
state.summary,
state.communityContext,
state.communityReflection,
);
let sections = parseSectionsFromCreateFlowState(state);
if (sections.length === 0) {
@@ -29,6 +29,11 @@ export const createFlowStateSchema = z
.object({
title: z.string().max(500).optional(),
summary: z.string().max(8000).optional(),
communityContext: z.string().max(8000).optional(),
communityReflection: z.string().max(8000).optional(),
selectedCommunitySizeIds: z.array(z.string()).optional(),
selectedOrganizationTypeIds: z.array(z.string()).optional(),
selectedGovernanceStyleIds: z.array(z.string()).optional(),
currentStep: createFlowStepSchema.optional(),
sections: z.array(z.unknown()).optional(),
stakeholders: z.array(z.unknown()).optional(),