refactor(webui): select Mail-owned profiles for campaigns

This commit is contained in:
2026-07-21 17:13:22 +02:00
parent 2c5519908a
commit 701c0fe184
13 changed files with 210 additions and 561 deletions

View File

@@ -0,0 +1,13 @@
export function campaignMailProfileReferenceOnly(value: Record<string, unknown>): Record<string, unknown> {
const server = isRecord(value.server) ? value.server : {};
const rawProfileId = server.mail_profile_id;
const profileId = typeof rawProfileId === "string" ? rawProfileId.trim() : "";
return {
...value,
server: profileId ? { mail_profile_id: profileId } : {}
};
}
function isRecord(value: unknown): value is Record<string, unknown> {
return Boolean(value) && typeof value === "object" && !Array.isArray(value);
}