Extract shared brandingVars() helper to eliminate duplication #17
Loading…
Reference in a new issue
No description provided.
Delete branch "mailship-90c-extract-shared-brandingvars-helper-brand-e34"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
mailship-90c
Extract a shared
brandingVars()helper that builds the branding object once, replacing three identical inline object literals in the/confirmhandler.The
{ brandName, brandAccent, brandLogo, settingsUrl }object was constructed identically at three call sites insrc/server.ts: theconfirm-errorpath (no-token guard), theconfirm-successpath, and theconfirm-errorcatch block. This change adds a small local factory function and spreads it at each site, reducing the four-line literal to a single line per call. Any future branding changes will need only one edit instead of three.The { brandName, brandAccent, brandLogo, settingsUrl } object was built identically 3 times in the /confirm handler. Extract a brandingVars() helper so it is defined once and reused via spread. Closes mailship-90c