Fix composition lookup by external product ID
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m1s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m1s
This commit is contained in:
@@ -1195,7 +1195,9 @@ const isSellableComposition = (order) => {
|
||||
};
|
||||
|
||||
const getTinyProductIdFromCompositionReference = (tinyId) => (
|
||||
tinyId.slice(TINY_OLIST_V3_COMPOSITION_PREFIX.length)
|
||||
tinyId.startsWith(TINY_OLIST_V3_COMPOSITION_PREFIX)
|
||||
? tinyId.slice(TINY_OLIST_V3_COMPOSITION_PREFIX.length)
|
||||
: tinyId
|
||||
);
|
||||
|
||||
const normalizeCompositionComponents = (components) => {
|
||||
@@ -1291,6 +1293,7 @@ const findProductCompositionsBySource = async (source, productId, client = pool)
|
||||
AND (
|
||||
$2 = ''
|
||||
OR composition.finished_tiny_product_id = $2
|
||||
OR composition.external_source_id = $2
|
||||
OR composition.finished_product_sku = UPPER($2)
|
||||
)
|
||||
ORDER BY composition.finished_product_sku, composition.finished_product_description;
|
||||
|
||||
Reference in New Issue
Block a user