Update create flow pages
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user