mirror of
https://github.com/samsonjs/spirit-tracker.git
synced 2026-03-25 09:25:51 +00:00
feat: Sierra fixes
This commit is contained in:
parent
4862558970
commit
06103b2a53
1 changed files with 6 additions and 4 deletions
|
|
@ -56,8 +56,12 @@ function parseWooStoreProductsJson(payload, ctx) {
|
|||
|
||||
const price = formatWooStorePrice(p.prices);
|
||||
|
||||
const id = (p && (p.id ?? p.id === 0)) ? String(p.id) : "";
|
||||
const taggedSku = id ? `id:${id}` : "";
|
||||
const rawSku =
|
||||
(typeof p?.sku === "string" && p.sku.trim()) ? p.sku.trim()
|
||||
: (p && (p.id ?? p.id === 0)) ? String(p.id)
|
||||
: "";
|
||||
|
||||
const taggedSku = /^\d{1,11}$/.test(rawSku) ? `id:${rawSku}` : rawSku;
|
||||
const sku = normalizeSkuKey(taggedSku, { storeLabel: ctx?.store?.name, url });
|
||||
|
||||
const img =
|
||||
|
|
@ -344,8 +348,6 @@ async function scanCategoryWooStoreApi(ctx, prevDb, report) {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
function createStore(defaultUa) {
|
||||
const ua = defaultUa;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue