Skip to content

Commit 3a5c714

Browse files
committed
refactor(dashboard): Use Order['shippingAddress'] for initialAddress type
Replace inline 9-field object type with derived Order['shippingAddress'] type, matching the codebase pattern of deriving subtypes from the Order type (e.g. Order['lines'], Order['shippingLines']).
1 parent 0a29a7f commit 3a5c714

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

packages/dashboard/src/app/routes/_authenticated/_orders/components/customer-address-selector.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { MapPin, Plus } from 'lucide-react';
1313
import { useState } from 'react';
1414
import { addressFragment } from '../../_customers/customers.graphql.js';
1515
import { getCustomerAddressesDocument } from '../orders.graphql.js';
16+
import { Order } from '../utils/order-types.js';
1617

1718
type CustomerAddressesQuery = ResultOf<typeof getCustomerAddressesDocument>;
1819

@@ -32,17 +33,7 @@ interface CustomerAddressSelectorProps {
3233
* Pre-populates the "New address" form with the given values. Used on the order modify page
3334
* so that editing an address doesn't require retyping all fields from scratch.
3435
*/
35-
initialAddress?: {
36-
fullName?: string | null;
37-
company?: string | null;
38-
streetLine1?: string | null;
39-
streetLine2?: string | null;
40-
city?: string | null;
41-
province?: string | null;
42-
postalCode?: string | null;
43-
countryCode?: string | null;
44-
phoneNumber?: string | null;
45-
};
36+
initialAddress?: Order['shippingAddress'];
4637
/**
4738
* @description
4839
* Custom label for the submit button in the "New address" form.

0 commit comments

Comments
 (0)