mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
fix(vendors): harden draft technician optional field typing
This commit is contained in:
parent
dbfb864206
commit
4cce4c1d69
1 changed files with 3 additions and 3 deletions
6
src/domain/vendors/utils/draft-vendor.ts
vendored
6
src/domain/vendors/utils/draft-vendor.ts
vendored
|
|
@ -8,13 +8,13 @@ export function isDraftVendorId(id: string | number | null | undefined): boolean
|
|||
}
|
||||
|
||||
export function createDraftVendorDropdownItem(payload: VendorFormValues): VendorDropdownItem {
|
||||
const email = payload.email.trim();
|
||||
const email = (payload.email ?? "").trim();
|
||||
return {
|
||||
id: `${DRAFT_VENDOR_ID_PREFIX}${crypto.randomUUID()}`,
|
||||
companyName: payload.companyName,
|
||||
contactName: payload.contactName,
|
||||
tradeSpecialties: payload.tradeSpecialties,
|
||||
address: payload.address,
|
||||
tradeSpecialties: payload.tradeSpecialties ?? "",
|
||||
address: payload.address ?? "",
|
||||
distanceMiles: null,
|
||||
email: email || undefined,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue