Files
klz-cables.com/.pnpm-store/v10/files/a5/da25df4cd5c318d87db9a412eec3e528d02077d0e0dde80c385d65018ac26b868ec27bf8cc76d838aeacd8a4a655bb47cb79efca95c6a8fcc8e701a8f9a5d2
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

28 lines
832 B
Plaintext

export const resolveFilterOptions = async (filterOptions, options) => {
const {
relationTo
} = options;
const relations = Array.isArray(relationTo) ? relationTo : [relationTo];
const query = {};
if (typeof filterOptions !== 'undefined') {
await Promise.all(relations.map(async relation => {
query[relation] = typeof filterOptions === 'function' ? await filterOptions({
...options,
relationTo: relation
}) : filterOptions;
if (query[relation] === true) {
query[relation] = {};
}
// this is an ugly way to prevent results from being returned
if (query[relation] === false) {
query[relation] = {
id: {
exists: false
}
};
}
}));
}
return query;
};
//# sourceMappingURL=resolveFilterOptions.js.map