Merge pull request #398 from useautumn/feature/customer2-restyle

feature: customer2 restyle
This commit is contained in:
John Yeo
2025-12-05 17:16:09 +00:00
committed by GitHub
4 changed files with 6 additions and 4 deletions

View File

@@ -173,7 +173,7 @@ export const previewToCheckoutRes = async ({
.filter(notNullish);
return CheckoutResponseV0Schema.parse({
customer_id: attachParams.customer.id,
customer_id: attachParams.customer.id || attachParams.customer.internal_id,
lines,
product: newProduct,
current_product: curProduct,

View File

@@ -24,7 +24,9 @@ export function AttachProductSheet() {
/>
<div className="flex-1 overflow-y-auto">
<AttachProductForm customerId={customer?.id ?? ""} />
<AttachProductForm
customerId={customer?.id ?? customer?.internal_id ?? ""}
/>
</div>
</div>
);

View File

@@ -30,7 +30,7 @@ const FormContent = ({
form: UseAttachProductForm;
}) => {
const { customer } = useCusQuery();
const customerId = customer?.id;
const customerId = customer?.id ?? customer?.internal_id;
const storeProduct = useProductStore((s) => s.product);
const product = storeProduct?.id ? storeProduct : (productV2 ?? undefined);
const entityId = cusProduct?.entity_id ?? undefined;

View File

@@ -59,7 +59,7 @@ export const CustomerPlanEditorBar = () => {
//navigate back to the customer plan page
pushPage({
path: `/customers/${customer?.id}/`,
path: `/customers/${customer?.id ?? customer?.internal_id}/`,
navigate,
preserveParams: false,
});