Give finished Rules a print path, folded launch counts, and a two-day follow-up.
Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
This commit is contained in:
1 parent
0efc907633
commit
d9c475a967
74 files changed
+2401
-630
No files matched your search
+11
-3
@@ -213,7 +213,7 @@ export async function publishRule(input: {
|
||||
document: Record<string, unknown>;
|
||||
stakeholderEmails?: string[];
|
||||
}): Promise<
|
||||
| { ok: true; id: string; title: string }
|
||||
| { ok: true; id: string; title: string; createdAt?: string }
|
||||
| { ok: false; error: string; status?: number }
|
||||
> {
|
||||
try {
|
||||
@@ -232,7 +232,7 @@ export async function publishRule(input: {
|
||||
});
|
||||
const data = (await safeParseJsonResponse(res)) as {
|
||||
error?: string | { message?: string };
|
||||
rule?: { id: string; title: string };
|
||||
rule?: { id: string; title: string; createdAt?: string };
|
||||
} | null;
|
||||
const rule = data && typeof data === "object" ? data.rule : undefined;
|
||||
if (!res.ok || !rule) {
|
||||
@@ -248,7 +248,14 @@ export async function publishRule(input: {
|
||||
status: res.status,
|
||||
};
|
||||
}
|
||||
return { ok: true, id: rule.id, title: rule.title };
|
||||
return {
|
||||
ok: true,
|
||||
id: rule.id,
|
||||
title: rule.title,
|
||||
...(typeof rule.createdAt === "string" && rule.createdAt.length > 0
|
||||
? { createdAt: rule.createdAt }
|
||||
: {}),
|
||||
};
|
||||
} catch {
|
||||
return {
|
||||
ok: false as const,
|
||||
@@ -344,6 +351,7 @@ export type PublishedRuleDetailForClient = {
|
||||
title: string;
|
||||
summary: string | null;
|
||||
document: unknown;
|
||||
createdAt?: string;
|
||||
};
|
||||
|
||||
export type FetchPublishedRuleDetailResult = {
|
||||
|
||||
Reference in new issue
Block a user