Delete proxy-auth.ts, types/index.ts, staff-user.ts+test, local-imports.ts+test (only used by their own tests). Remove unused foundation exports: sanitizeFilename, canonicalizeFormValue, canonicalizeFormData, ConflictError, getRequestStore, getClientIp, elapsed. Remove stale TODO comments from rank-authority.ts and notice.ts. Fix biome lint warnings in catalog-repair.ts.
27 lines
501 B
TypeScript
27 lines
501 B
TypeScript
export interface AdminMutationNotice {
|
|
tone: "ok" | "danger";
|
|
label: "Saved" | "Error";
|
|
message: string;
|
|
}
|
|
|
|
export function adminMutationNotice(params: {
|
|
saved?: string;
|
|
error?: string;
|
|
}): AdminMutationNotice | null {
|
|
if (params.error) {
|
|
return {
|
|
tone: "danger",
|
|
label: "Error",
|
|
message: "The operation could not be completed.",
|
|
};
|
|
}
|
|
if (params.saved === "1") {
|
|
return {
|
|
tone: "ok",
|
|
label: "Saved",
|
|
message: "Changes were saved successfully.",
|
|
};
|
|
}
|
|
return null;
|
|
}
|