You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
624 B
23 lines
624 B
import type {
|
|
AddressInput,
|
|
MothershipAddressCandidate,
|
|
} from "@/lib/frontend/types";
|
|
|
|
/** 将用户确认的 MotherShip 候选项合并进询价地址 */
|
|
export function applyMothershipCandidate(
|
|
base: AddressInput,
|
|
candidate: MothershipAddressCandidate,
|
|
): AddressInput {
|
|
return {
|
|
...base,
|
|
street: candidate.street,
|
|
city: candidate.city,
|
|
state: candidate.state,
|
|
zip: candidate.zip || base.zip,
|
|
formatted_address: candidate.formatted_address,
|
|
mothership_option_id: candidate.option_id,
|
|
mothership_display_label: candidate.display_label,
|
|
selected_from_mothership: true,
|
|
};
|
|
}
|