Fix trusted booking prices in POS hydration
This commit is contained in:
@@ -2252,8 +2252,7 @@ const hydrateSelectedOrderBookingForDesktop = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const forcedPrimaryPrice =
|
||||
typeof primaryRawItem?.price === "number" ? Number(primaryRawItem.price) : primaryProduct.price ?? null;
|
||||
const forcedPrimaryPrice = primaryProduct.price ?? null;
|
||||
const primaryItemResponse = await createOrderItem(
|
||||
normalizedOrderId,
|
||||
primaryProduct.id,
|
||||
@@ -2271,13 +2270,15 @@ const hydrateSelectedOrderBookingForDesktop = async () => {
|
||||
continue;
|
||||
}
|
||||
|
||||
const secondaryProduct = await fetchOrderBookingProductWithPricing(secondaryProductId);
|
||||
|
||||
await createOrderItem(
|
||||
normalizedOrderId,
|
||||
secondaryProductId,
|
||||
Math.max(1, Number.parseInt(String(bookingItem?.quantity ?? 1), 10) || 1),
|
||||
relatedPrimaryItemId,
|
||||
String(bookingItem?.notes ?? "").trim() || null,
|
||||
typeof bookingItem?.price === "number" ? Number(bookingItem.price) : null
|
||||
secondaryProduct?.price ?? null
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user